[219] | 1 | #ifndef __XMLIO_CObjectTemplate__ |
---|
| 2 | #define __XMLIO_CObjectTemplate__ |
---|
| 3 | |
---|
| 4 | /// xmlioserver headers /// |
---|
| 5 | #include "xmlioserver_spl.hpp" |
---|
| 6 | #include "attribute_map.hpp" |
---|
| 7 | #include "node_enum.hpp" |
---|
| 8 | |
---|
| 9 | namespace xmlioserver |
---|
| 10 | { |
---|
| 11 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 12 | template <class T> |
---|
| 13 | class CObjectTemplate |
---|
| 14 | : public CObject |
---|
| 15 | , public virtual tree::CAttributeMap |
---|
| 16 | { |
---|
| 17 | |
---|
| 18 | /// Friend /// |
---|
| 19 | friend class CObjectFactory; |
---|
| 20 | |
---|
| 21 | /// Typedef /// |
---|
| 22 | typedef tree::CAttributeMap SuperClassMap; |
---|
| 23 | typedef CObject SuperClass; |
---|
| 24 | typedef T DerivedType; |
---|
| 25 | |
---|
| 26 | public : |
---|
| 27 | |
---|
| 28 | /// Autres /// |
---|
| 29 | virtual StdString toString(void) const; |
---|
| 30 | virtual void fromString(const StdString & str); |
---|
| 31 | |
---|
| 32 | virtual void toBinary (StdOStream & os) const; |
---|
| 33 | virtual void fromBinary(StdIStream & is); |
---|
| 34 | |
---|
| 35 | virtual void parse(xml::CXMLNode & node); |
---|
| 36 | |
---|
| 37 | /// Accesseurs /// |
---|
| 38 | tree::ENodeType getType(void) const; |
---|
| 39 | |
---|
| 40 | /// Test /// |
---|
| 41 | virtual bool hasChild(void) const; |
---|
| 42 | |
---|
| 43 | /// Traitements /// |
---|
| 44 | virtual void solveDescInheritance(const CAttributeMap * const parent = 0); |
---|
| 45 | |
---|
| 46 | /// Traitement statique /// |
---|
| 47 | static void ClearAllAttributes(void); |
---|
| 48 | |
---|
| 49 | /// Accesseur statique /// |
---|
| 50 | static std::vector<boost::shared_ptr<DerivedType> > & |
---|
| 51 | GetAllVectobject(const StdString & contextId); |
---|
| 52 | |
---|
| 53 | /// Destructeur /// |
---|
| 54 | virtual ~CObjectTemplate(void); |
---|
| 55 | |
---|
| 56 | protected : |
---|
| 57 | |
---|
| 58 | /// Constructeurs /// |
---|
| 59 | CObjectTemplate(void); |
---|
| 60 | explicit CObjectTemplate(const StdString & id); |
---|
| 61 | CObjectTemplate(const CObjectTemplate<T> & object, |
---|
| 62 | bool withAttrList = true, bool withId = true); |
---|
| 63 | CObjectTemplate(const CObjectTemplate<T> * const object); // Not implemented. |
---|
| 64 | |
---|
| 65 | private : |
---|
| 66 | |
---|
| 67 | /// Propriétés statiques /// |
---|
| 68 | static xios_map<StdString, |
---|
| 69 | xios_map<StdString, |
---|
| 70 | boost::shared_ptr<DerivedType> > > AllMapObj; |
---|
| 71 | static xios_map<StdString, |
---|
| 72 | std::vector<boost::shared_ptr<DerivedType> > > AllVectObj; |
---|
| 73 | |
---|
| 74 | }; // class CObjectTemplate |
---|
| 75 | } // namespace xmlioserver |
---|
| 76 | |
---|
| 77 | #endif // __XMLIO_CObjectTemplate__ |
---|