16 #ifndef TORC_GENERIC_COMPOSITE_HPP
17 #define TORC_GENERIC_COMPOSITE_HPP
23 #include <boost/shared_ptr.hpp>
24 #include <boost/weak_ptr.hpp>
26 #ifdef GENOM_SERIALIZATION
27 #include <boost/serialization/access.hpp>
28 #include <boost/serialization/base_object.hpp>
29 #include <boost/serialization/weak_ptr.hpp>
30 #endif //GENOM_SERIALIZATION
46 #ifdef GENOM_SERIALIZATION
47 friend class boost::serialization::access;
61 typedef std::vector<Pointer>
List;
83 virtual size_t getSize()
const = 0;
108 virtual const Pointer get(
const std::vector<SizeType>& inIndices)
const throw (
Error) = 0;
126 #ifdef GENOM_SERIALIZATION
127 template <
class Archive>
void serialize(Archive& ar,
unsigned int);
128 #endif //GENOM_SERIALIZATION
138 mParentCollection() {}
147 mParentCollection = inParentCollection;
157 return mParentCollection.lock();
160 #ifdef GENOM_SERIALIZATION
163 ar & boost::serialization::base_object<SelfReferencing<_Type> >(*this);
166 #endif //GENOM_SERIALIZATION
171 #endif // TORC_GENERIC_COMPOSITE_HPP
virtual CompositionType getCompositionType() const =0
Interface for objects that can be composed within each other.
boost::shared_ptr< Type > Pointer
virtual void getChildren(List &outChildren) const =0
CompositionType
Defines possible Composition types.
The Error object thrown by different methods of EdifOM.
Composite< _Type > & operator=(const Composite< _Type > &rhs)
virtual Pointer getParentCollection() const
virtual size_t getSize() const =0
Contains definition for CompositionType.
WeakPointer mParentCollection
boost::weak_ptr< Type > WeakPointer
virtual void setParentCollection(const Pointer &inParentCollection)
std::vector< Pointer > List