/home/tetron/hack/vos/libs/vos/vos/metaobject.hh
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _METAOBJECT_HH_
00024 #define _METAOBJECT_HH_
00025
00026 #include <stdexcept>
00027 #include <typeinfo>
00028
00029 namespace VOS
00030 {
00031 #ifndef SWIG
00032 class MetaObject;
00033 #endif
00034 }
00035
00036 #include <vos/vos/vosdefs.hh>
00037 #include <vos/vos/vobject.hh>
00038
00039 namespace VOS
00040 {
00041 #ifndef SWIG
00042 class VobjectBase;
00043 #endif
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055 class VOS_API MetaObject : public virtual Vobject, public Dispatchable
00056 {
00057 private:
00058 VobjectBase* superobject;
00059 protected:
00060 MetaObject(VobjectBase* superobject);
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 virtual void doSaveState(MessageBlock& output, std::set<std::string>& types, bool portable);
00074
00075
00076
00077
00078 virtual void doExcise();
00079 virtual void doInitialize();
00080
00081 public:
00082
00083 virtual ~MetaObject();
00084
00085
00086
00087
00088
00089 virtual const std::string getVOSType();
00090
00091 virtual const std::string& getSiteName() const;
00092 virtual VUtil::vRef<Site> getSite() const;
00093 virtual const VUtil::URL& getURL() const;
00094 virtual bool isLocal();
00095 virtual bool isRemote();
00096 virtual TypeSetIterator getTypes();
00097 virtual void addType(const std::string& s);
00098 virtual void removeType(const std::string& s);
00099 virtual ParentSetIterator getParents();
00100 virtual ChildListIterator getChildren(int start = 0, int end = -1);
00101 virtual int numChildren();
00102
00103 virtual void sendMessage(Message* m);
00104 virtual void sendMessage(MessageBlock* m);
00105 virtual void sendUpdateMessage(Message* m);
00106
00107 virtual VUtil::vRef<Vobject> findObject(const std::string& path);
00108 virtual VUtil::vRef<ParentChildRelation> findChild(const std::string& path);
00109 virtual VUtil::vRef<ParentChildRelation> findChild(int pos);
00110 virtual VUtil::vRef<ParentChildRelation> findParent(Vobject* parent);
00111 virtual void setChild(int position, const std::string& contextual_name, Vobject* child);
00112 virtual void insertChild(int position, const std::string& contextual_name, Vobject* child);
00113 virtual void removeChild(ParentChildRelation* pcr, bool strict = true);
00114
00115 virtual void addTypeListener(TypeChangeListener* tl, bool refresh = true);
00116 virtual void addParentListener(ParentChangeListener* pl, bool refresh = true);
00117 virtual void addChildListener(ChildChangeListener* cl, bool refresh = true);
00118 virtual void removeTypeListener(TypeChangeListener* tl);
00119 virtual void removeParentListener(ParentChangeListener* pl);
00120 virtual void removeChildListener(ChildChangeListener* cl);
00121
00122 virtual void saveState(MessageBlock& output, std::set<std::string>& types, bool portable);
00123
00124 virtual void addFlag(const std::string& flag);
00125 virtual void removeFlag(const std::string& flag);
00126 virtual bool checkFlag(const std::string& flag);
00127
00128
00129
00130
00131
00132
00133
00134
00135 virtual void excise();
00136
00137
00138
00139
00140 virtual void acquire();
00141
00142
00143
00144
00145 virtual void release();
00146
00147
00148
00149
00150 virtual int getRefCount();
00151
00152 virtual VUtil::vRef<VobjectBase> getVobjectBase();
00153
00154 virtual StringIterator getPolicy(const std::string& domain, Identity* id);
00155 StringIterator getAvailablePolicies(const std::string& domain);
00156
00157 virtual void addToACL(const std::string& ACLname, Identity* id);
00158 virtual void addToACL(const std::string& ACLname, Group* grp);
00159
00160 virtual void removeFromACL(const std::string& ACLname, Identity* id);
00161 virtual void removeFromACL(const std::string& ACLname, Group* grp);
00162
00163 virtual void deleteACL(const std::string& policies);
00164
00165 virtual std::string getDefaultPolicy(const std::string& domain = "");
00166 virtual void setDefaultPolicy(const std::string& policy);
00167
00168 virtual ACLIterator getAllACLs();
00169
00170 friend class VobjectBase;
00171 };
00172
00173 }
00174
00175 #endif