00001 #ifndef SETREP_H 00002 #define SETREP_H 00003 00004 #include "BON.h" 00005 #include "BONImpl.h" 00006 00007 #include "Any.h" 00008 #include "FCO.h" 00009 #include "PointerItem.h" 00010 #include "ModelRep.h" 00011 #include "logger.h" 00012 00013 class SetRep : public FCO 00014 { 00015 public: // types 00016 typedef std::vector<FCO*> SetMemberList; 00017 typedef std::vector<FCO*>::iterator SetMemberList_Iterator; 00018 typedef std::vector<FCO*>::const_iterator SetMemberList_ConstIterator; 00019 00020 typedef std::vector< PointerItem> PointerItemSeries; 00021 typedef std::vector< PointerItem>::iterator PointerItemSeries_Iterator; 00022 typedef std::vector< PointerItem>::const_iterator PointerItemSeries_ConstIterator; 00023 typedef const ModelRep* Key; 00024 typedef std::map< Key, PointerItemSeries> SetMembersMap; 00025 typedef SetMembersMap::iterator SetMembersMap_Iterator; 00026 00027 public: // types 00028 SetRep( BON::FCO& ptr, BON::FCO& resp_ptr); 00029 ~SetRep(); 00030 00031 inline Any::KIND_TYPE getMyKind() const { return Any::SET; } 00032 00033 // adds new elements to the m_memberList vector 00034 void addMember( FCO * member); 00035 void extendMembership(); 00036 00037 std::string doDump(); 00038 00039 bool checkSetElements(); 00040 00041 std::string setGetterTemplate( const FCO * fco); 00042 void createMethods(); 00043 std::string expose( const std::string& repl_container); 00044 std::string hide(); 00045 protected: 00046 // stores those FCO-s which are in SET_MEMBER relationship with (*this) 00047 // coresponds to "initial" 00048 SetMemberList m_memberList; 00049 SetMemberList m_finalMemberList; 00050 00051 std::vector<Method> m_setMethods; 00052 00053 private: // forbiding copy 00054 SetRep( const SetRep&); 00055 const SetRep& operator=( const SetRep&); 00056 00057 }; 00058 00059 #endif //SETREP_H