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.
◆ Class_ID
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.
◆ Containerize()
gams::utility::Containerize::Containerize |
( |
const std::string & |
n = "" | ) |
|
◆ ~Containerize()
virtual gams::utility::Containerize::~Containerize |
( |
| ) |
|
|
virtual |
◆ check_valid_type()
virtual bool gams::utility::Containerize::check_valid_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| const |
|
privatepure virtual |
◆ from_container() [1/2]
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
◆ from_container() [2/2]
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
◆ from_container_impl()
virtual bool gams::utility::Containerize::from_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatepure virtual |
◆ get_name()
std::string gams::utility::Containerize::get_name |
( |
| ) |
const |
Get name of the object.
- Returns
- name of the object
◆ get_type()
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
◆ is_valid_type()
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
◆ modify()
void gams::utility::Containerize::modify |
( |
| ) |
|
Resend the information in the container using same knowledge base as previous to_container.
◆ set_knowledge_base()
void gams::utility::Containerize::set_knowledge_base |
( |
madara::knowledge::KnowledgeBase * |
kb | ) |
|
Set knowledge base to use.
◆ set_name()
void gams::utility::Containerize::set_name |
( |
const std::string & |
n | ) |
|
Set name of the object.
- Parameters
-
◆ to_container() [1/2]
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 |
◆ to_container() [2/2]
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 |
◆ to_container_impl()
virtual void gams::utility::Containerize::to_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatepure virtual |
◆ name_
std::string gams::utility::Containerize::name_ |
|
protected |
◆ object_type_suffix_
const std::string gams::utility::Containerize::object_type_suffix_ |
|
staticprotected |
◆ prev_kb_
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: