Go to the documentation of this file.00001
00002 #ifndef JOBOPTIONSVC_CATALOG_H_
00003 #define JOBOPTIONSVC_CATALOG_H_
00004
00005
00006
00007 #include <iostream>
00008 #include <string>
00009 #include <vector>
00010 #include <map>
00011 #include <set>
00012
00013
00014
00015 #include <boost/ptr_container/ptr_set.hpp>
00016
00017
00018
00019 #include "Property.h"
00020 #include "PropertyName.h"
00021 #include "PropertyValue.h"
00022
00023
00024
00025
00026
00027 namespace Gaudi { namespace Parsers {
00028
00029 class Catalog {
00030 public:
00031 typedef boost::ptr_set<Property, Property::LessThen> PropertySet;
00032 typedef std::map<std::string, PropertySet> CatalogSet;
00033
00034 typedef CatalogSet::value_type value_type;
00035 typedef CatalogSet::iterator iterator;
00036 typedef CatalogSet::const_iterator const_iterator;
00037
00038 iterator begin() { return catalog_.begin();}
00039 const_iterator begin() const { return catalog_.begin();}
00040 iterator end() { return catalog_.end();}
00041 const_iterator end() const{ return catalog_.end();}
00042
00043 std::vector<std::string> ClientNames() const;
00044 bool Add(Property* property);
00045 template<typename Value> bool Add(const std::string& client,
00046 const std::string& property, const Value& value);
00047 Property* Find(const std::string& client, const std::string& name);
00048 std::string ToString() const;
00050 std::ostream& fillStream ( std::ostream& out ) const ;
00051 private:
00052 CatalogSet catalog_;
00053 };
00054
00055 } }
00056
00057 template<typename Value> inline bool Gaudi::Parsers::Catalog::Add(
00058 const std::string& client, const std::string& property,
00059 const Value& value) {
00060 return Add(new Property(PropertyName(client, property), PropertyValue(value)));
00061 }
00062
00063
00065
00066 std::ostream& operator << ( std::ostream& o ,
00067 const Gaudi::Parsers::Catalog& c ) ;
00068
00069 #endif // JOBOPTIONSVC_CATALOG_H_