Urbi SDK Remote for C++  2.7.5
uobject-hub.hh
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2009, 2010, Gostai S.A.S.
00003  *
00004  * This software is provided "as is" without warranty of any kind,
00005  * either expressed or implied, including but not limited to the
00006  * implied warranties of fitness for a particular purpose.
00007  *
00008  * See the LICENSE file for more information.
00009  */
00010 
00012 
00013 #ifndef URBI_UOBJECT_HUB_HH
00014 # define URBI_UOBJECT_HUB_HH
00015 
00016 # include <urbi/fwd.hh>
00017 # include <urbi/ucontext.hh>
00018 namespace urbi
00019 {
00020 
00022   class URBI_SDK_API UObjectHub: public UContext
00023   {
00024   public:
00025 
00026     UObjectHub(const std::string&, impl::UContextImpl* ctx=0);
00027     virtual ~UObjectHub();
00028 
00029     void addMember(UObject* obj);
00030     void delMember(UObject* obj);
00031 
00033     void USetUpdate(ufloat period);
00034     virtual int update() {return 0;}
00035 
00036     urbi::UObjectList  members;
00037     urbi::UObjectList* getSubClass(const std::string&);
00038     //   UObjectList* getAllSubClass(const std::string&); //TODO
00039     const std::string& get_name() { return name;}
00040   protected:
00042     int updateGlobal();
00043 
00044     ufloat period;
00045     std::string name;
00046   };
00047 
00048 } // end namespace urbi
00049 
00050 #endif // ! URBI_UOBJECT_HUB_HH