OMNeT++ Simulation Library  5.6.1
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 
21 namespace omnetpp {
22 
23 class cConfiguration;
24 
37 {
38  public:
42  class KeyValue {
43  public:
44  virtual ~KeyValue() {}
45  virtual const char *getKey() const = 0;
46  virtual const char *getValue() const = 0;
47  virtual const char *getBaseDirectory() const = 0;
48  virtual const char *getFileName() const = 0;
49  virtual int getLineNumber() 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 
virtual const char * getDefaultBaseDirectory() const =0
virtual ~cConfigurationReader()
Definition: cconfigreader.h:56
virtual const KeyValue & getEntry(int sectionId, int entryId) const =0
virtual int getNumSections() const =0
Abstract base class for representing a key-value pair in the configuration.
Definition: cconfigreader.h:42
virtual int getNumEntries(int sectionId) const =0
virtual const char * getSectionName(int sectionId) const =0
virtual void dump() const =0
Abstract base class for configuration readers for SectionBasedConfiguration.
Definition: cconfigreader.h:36
Definition: cabstracthistogram.h:21
virtual void initializeFrom(cConfiguration *bootConfig)=0
Represents the configuration, as accessed by the simulation kernel.
Definition: cconfiguration.h:70