Changeset 15 in flair-src for trunk/lib/FlairCore/src/IODevice.cpp


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (5 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairCore/src/IODevice.cpp

    r2 r15  
    2424using std::string;
    2525
    26 namespace flair
    27 {
    28 namespace core
    29 {
     26namespace flair {
     27namespace core {
    3028
    31 IODevice::IODevice(const Object* parent,string name): Object(parent,name,"IODevice")
    32 {
    33     pimpl_=new IODevice_impl(this);
     29IODevice::IODevice(const Object *parent, string name)
     30    : Object(parent, name, "IODevice") {
     31  pimpl_ = new IODevice_impl(this);
    3432}
    3533
    36 IODevice::~IODevice()
    37 {
    38     delete pimpl_;
     34IODevice::~IODevice() { delete pimpl_; }
     35
     36void IODevice::AddDeviceToLog(const IODevice *device) {
     37  pimpl_->AddDeviceToLog(device);
    3938}
    4039
    41 void IODevice::AddDeviceToLog(const IODevice* device)
    42 {
    43     pimpl_->AddDeviceToLog(device);
     40void IODevice::OutputToShMem(bool enabled) { pimpl_->OutputToShMem(enabled); }
     41
     42void IODevice::ProcessUpdate(io_data *data) {
     43  if (data != NULL)
     44    data->pimpl_->SetConsistent(true);
     45
     46  for (size_t i = 0; i < TypeChilds()->size(); i++) {
     47    ((IODevice *)TypeChilds()->at(i))->UpdateFrom(data);
     48  }
     49
     50  if (data != NULL) {
     51    if (getFrameworkManager()->IsLogging() == true)
     52      pimpl_->WriteLog(data->DataTime());
     53
     54    data->pimpl_->Circle();
     55  }
     56
     57  pimpl_->WriteToShMem();
     58
     59  pimpl_->ResumeThread();
    4460}
    4561
    46 void IODevice::OutputToShMem(bool enabled) {
    47     pimpl_->OutputToShMem(enabled);
    48 }
     62void IODevice::AddDataToLog(const io_data *data) { pimpl_->AddDataToLog(data); }
    4963
    50 void IODevice::ProcessUpdate(io_data* data)
    51 {
    52     if(data!=NULL) data->pimpl_->SetConsistent(true);
     64DataType const &IODevice::GetInputDataType() const { return dummyType; }
    5365
    54     for(size_t i=0;i<TypeChilds()->size();i++)
    55     {
    56         ((IODevice*)TypeChilds()->at(i))->UpdateFrom(data);
    57     }
    58 
    59     if(data!=NULL)
    60     {
    61         if(getFrameworkManager()->IsLogging()==true) pimpl_->WriteLog(data->DataTime());
    62 
    63         data->pimpl_->Circle();
    64     }
    65 
    66     pimpl_->WriteToShMem();
    67 
    68     pimpl_->ResumeThread();
    69 }
    70 
    71 void IODevice::AddDataToLog(const io_data* data)
    72 {
    73     pimpl_->AddDataToLog(data);
    74 }
    75 
    76 DataType const &IODevice::GetInputDataType() const {
    77     return dummyType;
    78 }
    79 
    80 DataType const &IODevice::GetOutputDataType() const {
    81     return dummyType;
    82 }
     66DataType const &IODevice::GetOutputDataType() const { return dummyType; }
    8367
    8468} // end namespace core
Note: See TracChangeset for help on using the changeset viewer.