CARMA C++
SourceCatalog.h
Go to the documentation of this file.
1 #ifndef CARMA_SERVICES_SOURCECATALOG_H
2 #define CARMA_SERVICES_SOURCECATALOG_H
3 
4 #include <map>
5 
7 #include "carma/services/Source.h"
9 #include "carma/services/Table.h"
10 #include "carma/services/Types.h"
11 #include "carma/util/Program.h"
12 
20 namespace carma {
21  namespace services {
22 
28  class SourceCatalog : public carma::services::Catalog {
29  public:
30 
31  SourceCatalog() {}
32  virtual ~SourceCatalog() {}
33 
39  void open(const std::string& fileName);
40 
51  const carma::services::Source& lookup(const std::string& sourceName);
52 
58  static const std::string defaultCatalog() {
59  return carma::util::Program::getConfFile(DEFAULT_CATALOG);
60  }
61 
67 
73 
78  ::std::map< ::std::string, carma::services::Source > getSourceMap() const
79  {
80  return sources_;
81  }
82 
91  private:
92  // map of sources
93  std::map<std::string, carma::services::Source> sources_;
94  static const std::string DEFAULT_CATALOG;
95  static const unsigned short SOURCE_NAME_CHAR_LIMIT;
96 
97  }; // end class SourceCatalog
98 
99  }
100 }
101 
102 #endif // CARMA_SERVICES_SOURCECATALOG_H
carma::services::SourceIterator catalogEnd() const
SourceNotFoundException class.
Source is derived from CatalogEntry and is used to hold information for a particular entry from a sou...
Definition: Source.h:23
static const std::string defaultCatalog()
Definition: SourceCatalog.h:58
Various type definitions for services classes.
The SourceCatalog class is used to hold information regarding a particular source catalog file as ret...
Definition: SourceCatalog.h:28
carma::services::SourceIterator catalogBegin() const
void open(const std::string &fileName)
Open a file containing a source catalog.
Common table functions.
::std::map< ::std::string, carma::services::Source > getSourceMap() const
Definition: SourceCatalog.h:78
::std::string getConfFile(const ::std::string &filename)
Get the absolute path of a configuration file.
const carma::services::Source & lookup(const std::string &sourceName)
Select a source from the file of input sources.
::std::map< ::std::string, carma::services::Source >::const_iterator SourceIterator
A const iterator over a map of Sources.
Definition: Types.h:262