/* Generated by Together */

#ifndef MODELREP_H
#define MODELREP_H
#include "Any.h"
#include "RoleRep.h"
#include "FCO.h"
#include "Method.h"

class Sheet;
/**
 * Represents a Model kind. Since the containment relationship always refers to a model, this class has to have at least
 * references to the Roles. Has to contain the Aspect related information also.
 */
#include "list"
#include "map"
#include "vector"

class ModelRep : public FCO 
{
public: // types
	// roles
	typedef RoleRep RoleSeriesValue;
	typedef std::vector<RoleSeriesValue> RoleSeries;
	typedef RoleSeries::iterator RoleSeries_Iterator;
	typedef RoleSeries::const_iterator RoleSeries_ConstIterator;
	typedef FCO * RoleMapKey;
	typedef RoleSeries RoleMapValue;
	typedef std::map< RoleMapKey, RoleMapValue> RoleMap;
	typedef RoleMap::iterator RoleMap_Iterator;
	typedef RoleMap::const_iterator RoleMap_ConstIterator;

public:
	ModelRep( BON::FCO& ptr, BON::FCO& resp_ptr);
	~ModelRep();

	inline Any::KIND_TYPE getMyKind() const { return Any::MODEL; }
	std::string doDump();

	// Roles
	void addRole( RoleMapKey whose, RoleRep& role);
	void initRoles();
	bool getRoles( FCO * ptr, RoleMapValue& ) const;

	// Final roles
	void addFinalRole( RoleMapKey whose, RoleRep& role);
	bool getFinalRoles( const FCO * ptr, RoleMapValue& ) const;

	// inner models
	std::vector< ModelRep *> getInnerModels() const;
	std::vector< ModelRep *> getInnerModelsFinal() const;
	std::vector< ReferenceRep *> getInnerModelReferencesFinal() const;

	bool check();
	void inherit();

	void addMethod(Method& m) { m_methods.push_back( m); }
	void createMethods();
	std::string expose( const std::string& repl_container);
	std::string hide();

	static std::string roleGetterMethodName2( FCO * fco, RoleRep* role, bool use_fco_name, const std::string& diff_nmsp);
	static std::string roleGetterMethodName3( FCO * fco, RoleRep* role, bool use_fco_name, const std::string& diff_nmsp);

protected:
	RoleMap m_initialRoleMap;
	RoleMap m_finalRoleMap;

	std::vector<Method> m_methods;
	
private: // forbid copying
	ModelRep( const ModelRep&);
	const ModelRep& operator=( const ModelRep&);

};
#endif //MODELREP_H