36#ifndef CELLPROPERTYCOLLECTION_HPP_
37#define CELLPROPERTYCOLLECTION_HPP_
40#include <boost/shared_ptr.hpp>
43#include <boost/serialization/shared_ptr.hpp>
44#include <boost/serialization/set.hpp>
46#include "AbstractCellProperty.hpp"
47#include "CellPropertyRegistry.hpp"
81 template<
class Archive>
82 void serialize(Archive & archive,
const unsigned int version)
99 void AddProperty(
const boost::shared_ptr<AbstractCellProperty>& rProp);
118 bool HasProperty(
const boost::shared_ptr<AbstractCellProperty>& rProp)
const;
126 template<
typename CLASS>
131 if ((*it)->IsType<CLASS>())
145 template<
typename BASECLASS>
150 if ((*it)->IsSubType<BASECLASS>())
161 template<
typename CLASS>
166 if ((*it)->IsType<CLASS>())
172 EXCEPTION(
"Collection does not contain the given property type.");
180 void RemoveProperty(
const boost::shared_ptr<AbstractCellProperty>& rProp);
207 boost::shared_ptr<AbstractCellProperty>
GetProperty()
const;
213 template<
typename CLASS>
219 if ((*it)->IsType<CLASS>())
221 result.AddProperty(*it);
231 template<
typename BASECLASS>
237 if ((*it)->IsSubType<BASECLASS>())
239 result.AddProperty(*it);
#define EXCEPTION(message)
CollectionType::const_iterator ConstIteratorType
void serialize(Archive &archive, const unsigned int version)
boost::shared_ptr< AbstractCellProperty > GetProperty() const
CellPropertyCollection GetProperties() const
bool HasPropertyType() const
CollectionType::iterator Iterator
CollectionType::iterator IteratorType
CellPropertyCollection GetPropertiesType() const
std::set< boost::shared_ptr< AbstractCellProperty > > CollectionType
CollectionType mProperties
CellPropertyRegistry * mpCellPropertyRegistry
void AddProperty(const boost::shared_ptr< AbstractCellProperty > &rProp)
friend class boost::serialization::access
void SetCellPropertyRegistry(CellPropertyRegistry *pRegistry)
CellPropertyRegistry * GetCellPropertyRegistry()