object.h

Go to the documentation of this file.
00001 
00007 /*
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Lesser General Public
00010     License as published by the Free Software Foundation; either
00011     version 2.1 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Lesser General Public License for more details.
00017 
00018     You should have received a copy of the GNU Lesser General Public
00019     License along with this library; if not, write to the Free Software
00020     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00021 */
00022 
00023 #ifndef OMGUI_OBJECT_H
00024 #define OMGUI_OBJECT_H
00025 
00026 #include <omgui/dllimpexp.h>
00027 #include <omgui/api-prototypes.h>
00028 #include <omgui/types.h>
00029 #include <omgui/refcount.h>
00030 
00031 namespace omgui {
00032 
00040 class OMGUI_API Object : public RefCountable
00041 {
00042 public:
00046     object_id get_id() const;
00047 
00048 protected:
00054     Object(object_id id);
00055     virtual ~Object();
00056 
00057 private:
00058     const object_id m_id;
00059 };
00060 
00065 OMGUI_API Object *get_object_from_id(object_id id);
00066 
00070 template<typename T> T *get_object_from_id(object_id id)
00071 {
00072     return dynamic_cast<T*>(get_object_from_id(id));
00073 }
00074 
00075 } // omgui
00076 
00077 #endif // OMGUI_OBJECT_H

doxygen SourceForge.net Logo