OMNeT++ Simulation Library  6.0.3
cconfigreader.h
1 //==========================================================================
2 // CCONFIGREADER.H - part of
3 // OMNeT++/OMNEST
4 // Discrete System Simulation in C++
5 //
6 //==========================================================================
7 
8 /*--------------------------------------------------------------*
9  Copyright (C) 1992-2017 Andras Varga
10  Copyright (C) 2006-2017 OpenSim Ltd.
11 
12  This file is distributed WITHOUT ANY WARRANTY. See the file
13  `license' for details on this and other legal matters.
14 *--------------------------------------------------------------*/
15 
16 #ifndef __OMNETPP_CCONFIGREADER_H
17 #define __OMNETPP_CCONFIGREADER_H
18 
19 #include "simkerneldefs.h"
20 #include "fileline.h"
21 
22 namespace omnetpp {
23 
24 class cConfiguration;
25 
37 class /* NOT SIM_API */ cConfigurationReader
38 {
39  public:
43  class /* NOT SIM_API */ KeyValue {
44  public:
45  virtual ~KeyValue() {}
46  virtual const char *getKey() const = 0;
47  virtual const char *getValue() const = 0;
48  virtual const char *getBaseDirectory() const = 0;
49  virtual FileLine getSourceLocation() const = 0;
50  };
51 
52  public:
56  virtual ~cConfigurationReader() {}
57 
64  virtual void initializeFrom(cConfiguration *bootConfig) = 0;
65 
70  virtual const char *getFileName() const = 0;
71 
78  virtual const char *getDefaultBaseDirectory() const = 0;
79 
83  virtual int getNumSections() const = 0;
84 
89  virtual const char *getSectionName(int sectionId) const = 0;
90 
95  virtual int getNumEntries(int sectionId) const = 0;
96 
102  virtual const KeyValue& getEntry(int sectionId, int entryId) const = 0;
103 
108  virtual void dump() const = 0;
109 };
110 
111 } // namespace omnetpp
112 
113 #endif
114 
115 
omnetpp::cConfigurationReader::~cConfigurationReader
virtual ~cConfigurationReader()
Definition: cconfigreader.h:56
omnetpp::cConfigurationReader::getNumEntries
virtual int getNumEntries(int sectionId) const =0
omnetpp::cConfiguration
Represents the configuration, as accessed by the simulation kernel.
Definition: cconfiguration.h:76
omnetpp::cConfigurationReader::getEntry
virtual const KeyValue & getEntry(int sectionId, int entryId) const =0
omnetpp::cConfigurationReader::KeyValue
Abstract base class for representing a key-value pair in the configuration.
Definition: cconfigreader.h:43
omnetpp::cConfigurationReader::getSectionName
virtual const char * getSectionName(int sectionId) const =0
omnetpp::cConfigurationReader::dump
virtual void dump() const =0
omnetpp::cConfigurationReader
Abstract base class for configuration readers for SectionBasedConfiguration.
Definition: cconfigreader.h:37
omnetpp::cConfigurationReader::getDefaultBaseDirectory
virtual const char * getDefaultBaseDirectory() const =0
omnetpp::FileLine
Definition: fileline.h:27
omnetpp::cConfigurationReader::getFileName
virtual const char * getFileName() const =0
omnetpp::cConfigurationReader::getNumSections
virtual int getNumSections() const =0
omnetpp::cConfigurationReader::initializeFrom
virtual void initializeFrom(cConfiguration *bootConfig)=0