A class meant to assist with retrieving information into GAMS containers.
More...
#include <Containerize.h>
|
| bool | is_valid_type (madara::knowledge::KnowledgeBase &kb, const std::string &name, const Class_ID &expected) const |
| | Check if the type is correct. More...
|
| |
|
| static Class_ID | get_type (madara::knowledge::KnowledgeBase &kb, const std::string &name) |
| | Gets type of object in database. More...
|
| |
|
| std::string | name_ |
| | name of this object More...
|
| |
| madara::knowledge::KnowledgeBase * | prev_kb_ |
| | previous knowledge base used for sending objects More...
|
| |
|
| virtual bool | check_valid_type (madara::knowledge::KnowledgeBase &kb, const std::string &name) const =0 |
| | Check if object is of correct type. More...
|
| |
| virtual bool | from_container_impl (madara::knowledge::KnowledgeBase &kb, const std::string &name)=0 |
| | Load object from knowledge base. More...
|
| |
| virtual void | to_container_impl (madara::knowledge::KnowledgeBase &kb, const std::string &name)=0 |
| | Store object in knowledge base. More...
|
| |
A class meant to assist with retrieving information into GAMS containers.
Definition at line 71 of file Containerize.h.
These are used to check on the type of the object in from_container.
When inheriting from this class, add your new class to this list to check for your unique ID. Assign this value in the knowledge base to "prefix + object_type_suffix"
| Enumerator |
|---|
| REGION_TYPE_ID |
|
| PRIORITIZED_REGION_TYPE_ID |
|
| SEARCH_AREA_TYPE_ID |
|
| INVALID |
|
Definition at line 154 of file Containerize.h.
| gams::utility::Containerize::Containerize |
( |
const std::string & |
n = "" | ) |
|
| virtual gams::utility::Containerize::~Containerize |
( |
| ) |
|
|
virtual |
| virtual bool gams::utility::Containerize::check_valid_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| const |
|
privatepure virtual |
| bool gams::utility::Containerize::from_container |
( |
const std::string & |
name = "" | ) |
|
Load object from knowledge base.
- Parameters
-
| name | location of object in Knowlege Base |
- Returns
- true if object successfully loaded from knowledge base
| bool gams::utility::Containerize::from_container |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name = "" |
|
) |
| |
Load object from knowledge base.
- Parameters
-
| kb | Knowledge Base with object |
| name | location of object in Knowlege Base |
- Returns
- true if object successfully loaded from knowledge base
| virtual bool gams::utility::Containerize::from_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatepure virtual |
| std::string gams::utility::Containerize::get_name |
( |
| ) |
const |
Get name of the object.
- Returns
- name of the object
| static Class_ID gams::utility::Containerize::get_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
staticprotected |
Gets type of object in database.
- Parameters
-
| kb | Knowledge Base with object |
| name | Prefix of object in the KB |
- Returns
- Class_ID of object in kb
| bool gams::utility::Containerize::is_valid_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name, |
|
|
const Class_ID & |
expected |
|
) |
| const |
|
protected |
Check if the type is correct.
- Parameters
-
| kb | Knowledge Base with object |
| name | Prefix of object in the KB |
| expected | Expected value |
- Returns
- true if correct type, false otherwise
| void gams::utility::Containerize::modify |
( |
| ) |
|
Resend the information in the container using same knowledge base as previous to_container.
| void gams::utility::Containerize::set_knowledge_base |
( |
madara::knowledge::KnowledgeBase * |
kb | ) |
|
Set knowledge base to use.
| void gams::utility::Containerize::set_name |
( |
const std::string & |
n | ) |
|
Set name of the object.
- Parameters
-
| void gams::utility::Containerize::to_container |
( |
const std::string & |
name = "" | ) |
|
Store object in knowledge base used previously.
- Parameters
-
| name | location of object in Knowlege Base |
| void gams::utility::Containerize::to_container |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name = "" |
|
) |
| |
Store object in knowledge base.
- Parameters
-
| kb | Knowledge Base to store object in |
| name | location of object in Knowlege Base |
| virtual void gams::utility::Containerize::to_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatepure virtual |
| std::string gams::utility::Containerize::name_ |
|
protected |
| const std::string gams::utility::Containerize::object_type_suffix_ |
|
staticprotected |
| madara::knowledge::KnowledgeBase* gams::utility::Containerize::prev_kb_ |
|
protected |
previous knowledge base used for sending objects
Definition at line 146 of file Containerize.h.
The documentation for this class was generated from the following file: