/*
 * $Id: Component.cpp 113 2009-04-14 18:39:12Z rosiere $
 *
 * [ Description ]
 * 
 */

#include "Behavioural/include/Component.h"

namespace morpheo              {
namespace behavioural          {

  Component::Component  (Tusage_t usage):
    _usage (usage)
  {
    log_printf(FUNC,Behavioural,"Component::Component","Begin");
    _entity = NULL;
    _list_component = new std::list<Tcomponent_t *>;
    log_printf(FUNC,Behavioural,"Component::Component","End");
  };

  Component::Component  (const Component & component):
    _usage (component._usage)
  {
    log_printf(FUNC,Behavioural,"Component::Component (copy)","Begin");
    _entity         = component._entity        ;
    _list_component = component._list_component;
    log_printf(FUNC,Behavioural,"Component::Component (copy)","End");
  };
  
  Component::~Component ()
  {
    log_printf(FUNC,Behavioural,"Component::~Component","Begin");
    if (_entity != NULL)
      delete _entity;
    while (not _list_component->empty())
      {
        delete _list_component->front();
        _list_component->pop_front();
      }
    delete _list_component;
    log_printf(FUNC,Behavioural,"Component::~Component","End");
  };
  

}; // end namespace behavioural          
}; // end namespace morpheo              
