Browse Source

some more documentation

also call delete for objects created in parsers
as you can see, this is kind of ugly, maybe we should use a different structure there...
tempestpy_adaptions
gereon 12 years ago
parent
commit
07ac945794
  1. 3
      src/mrmc.cpp
  2. 1
      src/parser/readLabFile.cpp
  3. 4
      src/parser/readLabFile.h
  4. 1
      src/parser/readTraFile.cpp
  5. 3
      src/parser/readTraFile.h

3
src/mrmc.cpp

@ -107,6 +107,9 @@ int main(const int argc, const char* argv[]) {
delete s;
}
delete labparser.getLabeling();
delete traparser.getMatrix();
LOG4CPLUS_INFO(logger, "Nothing more to do, exiting.");
return 0;

1
src/parser/readLabFile.cpp

@ -46,6 +46,7 @@ namespace parser {
* @return The pointer to the created labeling object.
*/
LabParser::LabParser(uint_fast64_t node_count, const char * filename)
: labeling(nullptr)
{
/*
* open file

4
src/parser/readLabFile.h

@ -11,11 +11,15 @@ namespace parser {
/*!
* @brief Load label file and return initialized AtomicPropositionsLabeling object.
*
* Note that this class creates a new AtomicPropositionsLabeling object that can
* be accessed via getLabeling(). However, it will not delete this object!
*/
class LabParser : Parser
{
public:
LabParser(uint_fast64_t node_count, const char* filename);
mrmc::models::AtomicPropositionsLabeling* getLabeling()
{
return this->labeling;

1
src/parser/readTraFile.cpp

@ -118,6 +118,7 @@ uint_fast32_t TraParser::firstPass(char* buf, uint_fast32_t &maxnode)
*/
TraParser::TraParser(const char * filename)
: matrix(nullptr)
{
/*
* enforce locale where decimal point is '.'

3
src/parser/readTraFile.h

@ -11,6 +11,9 @@ namespace parser {
/*!
* @brief Load transition system from file and return initialized
* StaticSparseMatrix object.
*
* Note that this class creates a new StaticSparseMatrix object that can be
* accessed via getMatrix(). However, it does not delete this object!
*/
class TraParser : Parser
{

Loading…
Cancel
Save