source: flair-src/trunk/lib/FlairCore/src/IODevice.cpp@ 16

Last change on this file since 16 was 15, checked in by Bayard Gildas, 6 years ago

sources reformatted with flair-format-dir script

File size: 1.6 KB
RevLine 
[2]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[2]4// %flair:license}
5// created: 2011/05/01
6// filename: IODevice.cpp
7//
8// author: Guillaume Sanahuja
9// Copyright Heudiasyc UMR UTC/CNRS 7253
10//
11// version: $Id: $
12//
13// purpose: Abstract class for input/ouput system
14//
15//
16/*********************************************************************/
17
18#include "IODevice.h"
19#include "IODevice_impl.h"
20#include "io_data.h"
21#include "io_data_impl.h"
22#include "FrameworkManager.h"
23
24using std::string;
25
[15]26namespace flair {
27namespace core {
[2]28
[15]29IODevice::IODevice(const Object *parent, string name)
30 : Object(parent, name, "IODevice") {
31 pimpl_ = new IODevice_impl(this);
[2]32}
33
[15]34IODevice::~IODevice() { delete pimpl_; }
[2]35
[15]36void IODevice::AddDeviceToLog(const IODevice *device) {
37 pimpl_->AddDeviceToLog(device);
[2]38}
39
[15]40void IODevice::OutputToShMem(bool enabled) { pimpl_->OutputToShMem(enabled); }
[2]41
[15]42void IODevice::ProcessUpdate(io_data *data) {
43 if (data != NULL)
44 data->pimpl_->SetConsistent(true);
[2]45
[15]46 for (size_t i = 0; i < TypeChilds()->size(); i++) {
47 ((IODevice *)TypeChilds()->at(i))->UpdateFrom(data);
48 }
[2]49
[15]50 if (data != NULL) {
51 if (getFrameworkManager()->IsLogging() == true)
52 pimpl_->WriteLog(data->DataTime());
[2]53
[15]54 data->pimpl_->Circle();
55 }
[2]56
[15]57 pimpl_->WriteToShMem();
[2]58
[15]59 pimpl_->ResumeThread();
[2]60}
61
[15]62void IODevice::AddDataToLog(const io_data *data) { pimpl_->AddDataToLog(data); }
[2]63
[15]64DataType const &IODevice::GetInputDataType() const { return dummyType; }
[2]65
[15]66DataType const &IODevice::GetOutputDataType() const { return dummyType; }
[2]67
68} // end namespace core
69} // end namespace flair
Note: See TracBrowser for help on using the repository browser.