00001 // Copyright (C) 2006 University of Louisiana at Lafayette 00002 // Authors: Christopher Mire 00003 00004 #ifndef CAJUN_CBSIM_CONTROLLER_INTERFACE_H 00005 #define CAJUN_CBSIM_CONTROLLER_INTERFACE_H 00006 00007 #include "steering_sensor.H" 00008 #include "sim_util.H" 00009 00010 namespace cajun 00011 { 00012 class dynamic_object_t; 00013 00014 class controller_interface_t 00015 { 00016 public: 00017 controller_interface_t () 00018 { 00019 m_steering = NULL; 00020 m_steering_observer = NULL; 00021 m_timer = NULL; 00022 } 00023 controller_interface_t (dynamic_object_t *object, timer_t *timer) 00024 { 00025 m_steering_observer = NULL; 00026 assert (object != NULL); 00027 assert (timer != NULL); 00028 m_steering = new steering_sensor_t (object, timer); 00029 m_timer = timer; 00030 } 00031 virtual ~controller_interface_t () 00032 { 00033 if (m_steering != NULL) 00034 delete m_steering; 00035 }; 00036 protected: 00037 steering_sensor_t *m_steering; 00038 timer_t::observer_t *m_steering_observer; 00039 timer_t *m_timer; 00040 std::list<timer_t::observer_t *>::iterator m_observer_index; 00041 }; 00042 } 00043 #endif