Changeset 46 in pacpusframework


Ignore:
Timestamp:
Jan 8, 2013, 11:52:19 PM (12 years ago)
Author:
sgosseli
Message:

Improvement: when instantiated, check if ComponentBase is base of T.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/Pacpus/kernel/ComponentFactory.h

    r45 r46  
    1515
    1616#include <cassert>
     17
     18#include <boost/static_assert.hpp>
     19#include <boost/type_traits/is_base_of.hpp>
    1720
    1821#include <Pacpus/kernel/ComponentFactoryBase.h>
     
    4043    : public ComponentFactoryBase
    4144{
     45    BOOST_STATIC_ASSERT_MSG((boost::is_base_of<ComponentBase, T>::value), "T must inherit from ComponentBase");
    4246public:
    4347    /** Ctor of ComponentFactory, initialize the factory of the components of type @em T.
Note: See TracChangeset for help on using the changeset viewer.