00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TORC_GENERIC_OM_SINGLEINSTANCE_HPP
00017 #define TORC_GENERIC_OM_SINGLEINSTANCE_HPP
00018
00019 #include "torc/generic/om/PointerTypes.hpp"
00020 #include "torc/generic/om/DumpRestoreConfig.hpp"
00021
00022 #ifdef GENOM_SERIALIZATION
00023 #include <boost/serialization/access.hpp>
00024 #endif //GENOM_SERIALIZATION
00025
00026 #include "torc/generic/om/Instance.hpp"
00027 #include "torc/generic/om/Scalar.hpp"
00028 #include "torc/generic/om/FactoryType.hpp"
00029 #include "torc/generic/om/VisitorType.hpp"
00030 #include "torc/generic/util/Error.hpp"
00031
00032 namespace torc { namespace generic { class BaseVisitor; } }
00033
00034 namespace torc {
00035
00036 namespace generic {
00037
00038
00039
00040
00041
00042
00043 class SingleInstance
00044 : public Instance,
00045 public Scalar<Instance> {
00046 #ifdef GENOM_SERIALIZATION
00047 friend class boost::serialization::access;
00048 #endif //GENOM_SERIALIZATION
00049
00050 friend class FactoryType<SingleInstance>;
00051
00052 public:
00053 typedef VisitorType<SingleInstance> Visitor;
00054
00055
00056
00057
00058 class Factory: public FactoryType<SingleInstance>
00059 {
00060 public:
00061 using FactoryType<SingleInstance>::create;
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071 virtual SingleInstanceSharedPtr
00072 newSingleInstancePtr( const std::string &inName,
00073 const ViewSharedPtr &inViewPtr,
00074 const ViewSharedPtr &inMasterPtr,
00075 const std::string &inOriginalName = std::string()) throw(Error);
00076 };
00077
00078 virtual void
00079 accept(BaseVisitor &inoutVisitor) throw(Error);
00080
00081
00082
00083
00084 virtual void
00085 flatten() throw(Error);
00086
00087 virtual
00088 ~SingleInstance() throw();
00089
00090 protected:
00091 SingleInstance();
00092
00093 private:
00094 #ifdef GENOM_SERIALIZATION
00095 template<class Archive> void
00096 serialize( Archive &ar, unsigned int );
00097 #endif //GENOM_SERIALIZATION
00098
00099 };
00100
00101 }
00102
00103 }
00104 #endif // TORC_GENERIC_OM_SINGLEINSTANCE_HPP