00001 #ifndef FOLDERREP_H 00002 #define FOLDERREP_H 00003 00004 #include "Any.h" 00005 #include "FCO.h" 00006 #include "FolderRep.h" 00007 #include "ModelRep.h" 00008 #include "AtomRep.h" 00009 #include "ConnectionRep.h" 00010 #include "SetRep.h" 00011 #include "ReferenceRep.h" 00012 #include "FcoRep.h" 00013 00014 #include "list" 00015 #include "vector" 00016 /* 00017 class FolderElem 00018 { 00019 FolderElem( const Any * m_ptr, const std::string &m_card); 00020 bool operator==( const FolderElem& peer); 00021 Any * getElem() const; 00022 const std::string & getCard() const; 00023 private: 00024 const FolderElem& operator=(const FolderElem& peer); 00025 FolderElem( const FolderElem&); 00026 00027 Any * m_elem; 00028 std::string m_card; 00029 }; 00030 */ 00031 class FolderRep : public Any 00032 { 00033 public: // types 00034 typedef std::vector<FCO*>::iterator FCO_Iterator; 00035 typedef std::vector<FolderRep*>::iterator SubFolder_Iterator; 00036 typedef std::vector<FolderRep*>::const_iterator SubFolder_ConstIterator; 00037 00038 public: 00039 /* 00040 A FolderRep is created by using the id, ptr and resp_ptr which is the object 00041 selected using the SameFolder Selection Mechanism when SameFolder relation is met. 00042 That is why a folder has to redefine the getName operations 00043 */ 00044 FolderRep( BON::FCO& ptr, BON::FCO& resp_ptr); 00045 ~FolderRep(); 00046 00047 /*virtual*/ Any::KIND_TYPE getMyKind() const { return Any::FOLDER; } 00048 /*virtual*/ std::string getName() const; 00049 00050 void addFCO( FCO * ptr, const std::string & card); 00051 bool isFCOContained( FCO * otr); 00052 00053 void addSubFolderRep( FolderRep * ptr, const std::string & card); 00054 void extendMembership(); 00055 00056 std::string doDump(); 00057 00058 void addMethod(Method& m) { m_methods.push_back( m); } 00059 void createMethods(); 00060 00061 static std::string subFolderGetterMethodName(FolderRep * fold, const std::string& diff_nmsp); 00062 static std::string kindGetterMethodName( FCO * fco, const std::string& diff_nmsp); 00063 00064 protected: 00065 std::vector<FCO *> m_fcoList; 00066 std::vector<std::string> m_fcoCardList; 00067 00071 std::vector<FolderRep*> m_subFolderList; 00072 /* Cardinality for the folders above */ 00073 std::vector<std::string> m_subCardList; 00074 00079 BON::FCO m_respPointer; 00080 00081 std::vector<Method> m_methods; 00082 00083 private: // forbiding copy 00084 FolderRep( const FolderRep&); 00085 const FolderRep& operator=( const FolderRep&); 00086 00087 }; 00088 #endif //FOLDERREP_H