00001
00002
00003 #ifndef MODELREP_H
00004 #define MODELREP_H
00005 #include "Any.h"
00006 #include "RoleRep.h"
00007 #include "FCO.h"
00008 #include "Method.h"
00009
00010 class Sheet;
00015 #include "list"
00016 #include "map"
00017 #include "vector"
00018
00019 class ModelRep : public FCO
00020 {
00021 public:
00022
00023 typedef RoleRep RoleSeriesValue;
00024 typedef std::vector<RoleSeriesValue> RoleSeries;
00025 typedef RoleSeries::iterator RoleSeries_Iterator;
00026 typedef RoleSeries::const_iterator RoleSeries_ConstIterator;
00027 typedef FCO * RoleMapKey;
00028 typedef RoleSeries RoleMapValue;
00029 typedef std::map< RoleMapKey, RoleMapValue> RoleMap;
00030 typedef RoleMap::iterator RoleMap_Iterator;
00031 typedef RoleMap::const_iterator RoleMap_ConstIterator;
00032
00033 public:
00034 ModelRep( BON::FCO& ptr, BON::FCO& resp_ptr);
00035 ~ModelRep();
00036
00037 inline Any::KIND_TYPE getMyKind() const { return Any::MODEL; }
00038 std::string doDump();
00039
00040
00041 void addRole( RoleMapKey whose, RoleRep& role);
00042 void initRoles();
00043 bool getRoles( FCO * ptr, RoleMapValue& ) const;
00044
00045
00046 void addFinalRole( RoleMapKey whose, RoleRep& role);
00047 bool getFinalRoles( const FCO * ptr, RoleMapValue& ) const;
00048
00049
00050 std::vector< ModelRep *> getInnerModels() const;
00051 std::vector< ModelRep *> getInnerModelsFinal() const;
00052 std::vector< ReferenceRep *> getInnerModelReferencesFinal() const;
00053
00054 bool check();
00055 void inherit();
00056
00057 void addMethod(Method& m) { m_methods.push_back( m); }
00058 void createMethods();
00059 std::string expose( const std::string& repl_container);
00060 std::string hide();
00061
00062 static std::string roleGetterMethodName2( FCO * fco, RoleRep* role, bool use_fco_name, const std::string& diff_nmsp);
00063 static std::string roleGetterMethodName3( FCO * fco, RoleRep* role, bool use_fco_name, const std::string& diff_nmsp);
00064
00065 protected:
00066 RoleMap m_initialRoleMap;
00067 RoleMap m_finalRoleMap;
00068
00069 std::vector<Method> m_methods;
00070
00071 private:
00072 ModelRep( const ModelRep&);
00073 const ModelRep& operator=( const ModelRep&);
00074
00075 };
00076 #endif //MODELREP_H