27 :
SyncLayer(p), interface_(interface), step_(p.period_ms_), half_step_(p.period_ms_/2), nodes_size_(0)
32 boost::mutex::scoped_lock lock(nodes_mutex_);
34 nodes_size_ = nodes_.size();
37 boost::mutex::scoped_lock lock(nodes_mutex_);
39 nodes_size_ = nodes_.size();
48 if(current_state >
Init){
49 boost::this_thread::sleep_until(read_time_);
54 if(current_state >
Init){
56 boost::this_thread::sleep_until(write_time_);
78 if(current_state >
Init){
107 return boost::make_shared<WrapMaster>(interface);
std::set< void * > nodes_
const SyncProperties properties
can::BufferedReader reader_
void listen(CommInterfaceSharedPtr interface)
virtual void handleWrite(LayerStatus &status, const LayerState ¤t_state)
virtual MasterSharedPtr allocate(const std::string &name, can::CommInterfaceSharedPtr interface)
virtual void handleShutdown(LayerStatus &status)
can::CommInterfaceSharedPtr interface_
bool readUntil(can::Frame *msg, boost::chrono::high_resolution_clock::time_point abs_time)
const can::Header header_
can::CommInterfaceSharedPtr interface_
CLASS_LOADER_REGISTER_CLASS(canopen::SimpleMaster::Allocator, canopen::Master::Allocator)
boost::shared_ptr< CommInterface > CommInterfaceSharedPtr
boost::chrono::milliseconds step_
boost::chrono::high_resolution_clock::time_point time_point
virtual SyncLayerSharedPtr getSync(const SyncProperties &properties)
virtual void addNode(void *const ptr)
virtual void handleRead(LayerStatus &status, const LayerState ¤t_state)
WrapMaster< SimpleSyncLayer > SimpleMaster
WrapMaster(can::CommInterfaceSharedPtr interface)
virtual void handleRecover(LayerStatus &status)
boost::atomic< size_t > nodes_size_
boost::shared_ptr< Master > MasterSharedPtr
SimpleSyncLayer(const SyncProperties &p, can::CommInterfaceSharedPtr interface)
virtual void handleRead(LayerStatus &status, const LayerState ¤t_state)
WrapMaster< ExternalSyncLayer > ExternalMaster
virtual void handleInit(LayerStatus &status)
virtual void removeNode(void *const ptr)
boost::chrono::milliseconds half_step_
ManagingSyncLayer(const SyncProperties &p, can::CommInterfaceSharedPtr interface)
boost::mutex nodes_mutex_
virtual void handleDiag(LayerReport &report)
ExternalSyncLayer(const SyncProperties &p, can::CommInterfaceSharedPtr interface)
time_point get_abs_time(const time_duration &timeout)
boost::shared_ptr< SyncLayer > SyncLayerSharedPtr
virtual void handleInit(LayerStatus &status)
virtual void handleWrite(LayerStatus &status, const LayerState ¤t_state)
virtual void handleHalt(LayerStatus &status)