28 |
|
|
29 |
|
#include <list> |
30 |
|
|
31 |
+ |
#include "io/SectionParser.hpp" |
32 |
+ |
|
33 |
|
namespace oopse { |
34 |
|
|
35 |
|
struct SectionParserContext { |
40 |
|
bool isActive; |
41 |
|
}; |
42 |
|
|
43 |
+ |
class SameSectionParserFunctor { |
44 |
+ |
public: |
45 |
+ |
SameSectionParserFunctor(const std::string section) : section_(section) {} |
46 |
+ |
|
47 |
+ |
bool operator()(SectionParserContext context) { |
48 |
+ |
return context.sectionParser->getSectionName() == section_; |
49 |
+ |
} |
50 |
+ |
|
51 |
+ |
private: |
52 |
+ |
std::string section_; |
53 |
+ |
}; |
54 |
|
/** |
55 |
|
* @class SectionParserManager SectionParserManager.hpp "io/SectionParserManager.hpp" |
56 |
|
* SectionParserManager maintains a priority list |
59 |
|
|
60 |
|
public: |
61 |
|
typedef std::list<SectionParserContext> SectionParserContextList; |
62 |
< |
typedef typename SectionParserContextList::iterator iterator; |
63 |
< |
typedef typename SectionParserContextList::const_iterator const_iterator; |
62 |
> |
typedef SectionParserContextList::iterator iterator; |
63 |
> |
typedef SectionParserContextList::const_iterator const_iterator; |
64 |
|
|
65 |
|
SectionParserManager() : beginPriority_(0), priorityDifference_(100) {} |
66 |
|
~SectionParserManager(); |
67 |
|
|
68 |
< |
void parse(ifstrstream& input, ForceField& ff); |
68 |
> |
void parse(std::istream& input, ForceField& ff); |
69 |
|
|
70 |
|
void push_front(SectionParser* sp); |
71 |
|
|