CARMA C++
Catalog.h
Go to the documentation of this file.
1 
10 #ifndef CARMA_SERVICES_CATALOG_H
11 #define CARMA_SERVICES_CATALOG_H
12 
13 #include "carma/services/Table.h"
16 
17 namespace carma {
18 namespace services {
19 
20  class Catalog {
21  public:
22  Catalog();
23  virtual ~Catalog();
24 
31  void open(const std::string& fileName);
32 
40  virtual const carma::services::CatalogEntry&
41  lookup(const std::string& entryName) = 0;
42 
47  virtual bool contains( const std::string & entryName ) {
48  try {
49  lookup( entryName );
50  return true;
51  } catch ( const CatalogEntryNotFoundException & ex ) {
52  return false;
53  }
54  }
55 
56 
66  void setCommentColumnNo(const long columnNo)
67  {
68  commentColumnNo_ = columnNo;
69  }
70 
75  long getCommentColumnNo() const {
76  return commentColumnNo_;
77  }
78 
84  bool hasCommentColumn() const {
85  return ( commentColumnNo_ == NO_COMMENT);
86  }
87 
91  std::string getFileName() const {
92  return fileName_;
93  }
94 
99  static const long NO_COMMENT = -1;
100 
101  protected:
102  carma::services::Table catalogTable_;
103  std::string fileName_;
104 
105  private:
110  long commentColumnNo_;
111 
112 
113  }; // end class Catalog
114 }; // end namespace services
115 }; // end namespace carma
116 
117 #endif
CatalogEntryNotFoundException class.
Common table functions.
Simple ASCII Table format, fully memory based.
Definition: Table.h:126