Container.hpp
Go to the documentation of this file.00001 #ifndef CONTAINER_CLASS_H
00002 #define CONTAINER_CLASS_H 1
00003
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <map>
00031 #include "ContainerItem.hpp"
00032
00033 #ifdef CXX_NAMESPACES
00034 XERCES_CPP_NAMESPACE_USE
00035 namespace prf{
00036 #endif
00037
00045 class Container {
00046
00047 public:
00048
00049 typedef ContainerItem element_type;
00050
00051 typedef element_type::value_type value_type;
00052 typedef const element_type::value_type const_value_type;
00053
00054 typedef value_type key_type;
00055 typedef unsigned int hash_type;
00056
00057 typedef element_type::repr_type repr_type;
00058
00059 typedef size_t size_type;
00060
00061 typedef std::map<const hash_type, element_type*> container_type;
00062
00063 typedef container_type::iterator iterator;
00064
00065 virtual ~Container() throw();
00066
00068 static const value_type child_name;
00069
00075 virtual void deleteItem(const key_type idkey);
00076 virtual void deleteItem(const char *idkey);
00077
00083 virtual element_type *getItem(const key_type key);
00084 virtual element_type *getItem(const char* key);
00085
00093 virtual void setItem(const key_type idkey, element_type *value);
00094 virtual void setItem(const char* idkey, element_type *value);
00095
00100 virtual iterator addItem(element_type* _elem);
00101
00105 virtual void addItems(container_type& _elems);
00106
00107
00113 virtual iterator createItem(key_type idkey) = 0;
00114
00118 virtual size_type size() const;
00119
00123 virtual repr_type *getNode();
00124
00125
00126
00127
00132 virtual element_type &operator[] (const key_type key);
00137 virtual element_type &operator[] (const char* key);
00138
00139
00140
00145 virtual iterator begin();
00146
00151 virtual iterator end();
00152
00153
00154 protected:
00155
00156 Container(){}
00157 Container(Container &){}
00158 Container &operator=(Container){}
00159
00160 inline void deleteItem(const hash_type hash);
00161 inline element_type *getItem(const hash_type hash);
00162 inline void setItem(const hash_type hash, element_type *value);
00163
00168 container_type *elem;
00169
00174 repr_type *xelem;
00175
00176 };
00177
00178 #ifdef CXX_NAMESPACES
00179 }
00180 #endif
00181
00182 #endif
Generated on Tue May 11 05:03:49 2004 for libprf1 by
1.3.6-20040222