Last change
on this file since 231 was
219,
checked in by hozdoba, 13 years ago
|
Préparation nouvelle arborescence
|
File size:
1.6 KB
|
Rev | Line | |
---|
[219] | 1 | #ifndef __XMLIO_CObjectFactory__ |
---|
| 2 | #define __XMLIO_CObjectFactory__ |
---|
| 3 | |
---|
| 4 | /// boost headers /// |
---|
| 5 | #include <boost/shared_ptr.hpp> |
---|
| 6 | |
---|
| 7 | /// xmlioserver headers /// |
---|
| 8 | #include "xmlioserver_spl.hpp" |
---|
| 9 | #include "exception.hpp" |
---|
| 10 | #include "object_template.hpp" |
---|
| 11 | |
---|
| 12 | namespace xmlioserver |
---|
| 13 | { |
---|
| 14 | /// ////////////////////// Déclarations ////////////////////// /// |
---|
| 15 | class CObjectFactory |
---|
| 16 | { |
---|
| 17 | public : |
---|
| 18 | |
---|
| 19 | /// Mutateurs /// |
---|
| 20 | static void SetCurrentContextId(const StdString & context); |
---|
| 21 | |
---|
| 22 | /// Accesseurs /// |
---|
| 23 | static StdString & GetCurrentContextId(void); |
---|
| 24 | |
---|
| 25 | template <typename U> |
---|
| 26 | static inline boost::shared_ptr<U> GetObject(const StdString & id); |
---|
| 27 | |
---|
| 28 | template <typename U> |
---|
| 29 | static inline boost::shared_ptr<U> GetObject(const U * const object); |
---|
| 30 | |
---|
| 31 | template <typename U> |
---|
| 32 | static inline int GetObjectNum(void); |
---|
| 33 | template <typename U> |
---|
| 34 | static inline int GetObjectIdNum(void); |
---|
| 35 | |
---|
| 36 | template <typename U> |
---|
| 37 | static inline const std::vector<boost::shared_ptr<U> > & |
---|
| 38 | GetObjectVector(const StdString & context = CObjectFactory::GetCurrentContextId()); |
---|
| 39 | |
---|
| 40 | /// Tests /// |
---|
| 41 | template <typename U> |
---|
| 42 | static inline bool HasObject(const StdString & id); |
---|
| 43 | |
---|
| 44 | /// Instanciateur /// |
---|
| 45 | template <typename U> |
---|
| 46 | static inline boost::shared_ptr<U> CreateObject(const StdString & id = StdString("")); |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | private : |
---|
| 50 | |
---|
| 51 | /// Propriétés statiques /// |
---|
| 52 | static StdString CurrContext; |
---|
| 53 | |
---|
| 54 | }; // class CObjectFactory |
---|
| 55 | } // namespace xmlioserver |
---|
| 56 | |
---|
| 57 | #include "object_factory_impl.hpp" |
---|
| 58 | |
---|
| 59 | #endif // __XMLIO_CObjectFactory__ |
---|
Note: See
TracBrowser
for help on using the repository browser.