cm_registry.h

00001 /* -- 2007-05-07 -- 
00002  *  ardev - an augmented reality library for robot developers
00003  *  Copyright 2005-2007 - Toby Collett (ardev _at_ plan9.net.nz)
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public
00016  *  License along with this library; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
00018  *
00019  */
00020 #ifndef ARIDE_REGISTRY_H
00021 #define ARIDE_REGISTRY_H
00022 
00023 #include <string.h>
00024 
00025 #include <map>
00026 using namespace std;
00027 
00028 #include "cm_project.h"
00029 
00030 class ObjectHandler;
00031 typedef ObjectHandler * (create_objecthandler)(void);
00032 
00033 class ObjectRegistryEntry
00034 {
00035         public:
00036                 ObjectRegistryEntry() {CreateHandler=NULL;};
00037                 ObjectRegistryEntry(create_objecthandler * inCreateHandler,ArideSection inSection)
00038                 {
00039                         CreateHandler = inCreateHandler;
00040                         Section = inSection;
00041                 };
00042                 ~ObjectRegistryEntry() {;};
00043         
00044                 ArideSection Section;
00045                 create_objecthandler * CreateHandler;           
00046 };
00047 
00048 struct ltstr
00049 {
00050   bool operator()(const char* s1, const char* s2) const
00051   {
00052     return strcmp(s1, s2) < 0;
00053   }
00054 };
00055 
00056 typedef map<const char *, ObjectRegistryEntry,ltstr> ObjectHandlerRegistryMap;
00057 extern map<const char *, ObjectRegistryEntry,ltstr> ObjectHandlerRegistry;
00058 
00059 #endif

SourceForge.net Logo Generated on Sat May 12 15:25:43 2007 for ardev by doxygen 1.5.1