11 #define BOOST_TEST_MODULE customEntity 13 #if BOOST_VERSION >= 105900 14 #include <boost/test/tools/output_test_stream.hpp> 16 #include <boost/test/output_test_stream.hpp> 18 #include <boost/test/unit_test.hpp> 20 using boost::test_tools::output_test_stream;
31 void display(std::ostream &os)
const { os <<
"custom entity"; }
42 BOOST_CHECK_EQUAL(entity->
getName(),
"my-entity");
43 BOOST_CHECK_EQUAL(entity->Entity::getClassName(),
"Entity");
56 output_test_stream output;
59 BOOST_CHECK(output.is_equal(
"custom entity"));
CustomEntity(const std::string &n)
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
virtual const std::string & getClassName() const
static const std::string CLASS_NAME
BOOST_AUTO_TEST_CASE(constructor)
void display(std::ostream &os) const
Display information on the entity inside the output stream os.
virtual const std::string & getClassName() const
virtual void display(std::ostream &os) const
Display information on the entity inside the output stream os.
static void destroy()
Destroy the unique instance of the class.
Entity(const std::string &name)
const std::string & getName() const
Entity * newEntity(const std::string &classname, const std::string &objname) const
Instantiate (and allocate) an entity.
static FactoryStorage * getInstance()
Get pointer to unique object of the class.
DYNAMICGRAPH_FACTORY_ENTITY_PLUGIN(CustomEntity, "CustomEntity")