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


Ignore:
Timestamp:
04/08/16 15:40:57 (8 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

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

    r2 r15  
    2323using namespace flair::core;
    2424
    25 io_data_impl::io_data_impl(io_data* self,int n) {
    26     this->self=self;
    27     this->n=n;
    28     if(n<1) self->Err("n doit être >0\n");
    29     size=0;
    30     is_consistent=false;
    31     circle_ptr=NULL;
     25io_data_impl::io_data_impl(io_data *self, int n) {
     26  this->self = self;
     27  this->n = n;
     28  if (n < 1)
     29    self->Err("n doit être >0\n");
     30  size = 0;
     31  is_consistent = false;
     32  circle_ptr = NULL;
    3233}
    3334
    3435io_data_impl::~io_data_impl() {}
    3536
    36 void io_data_impl::AppendLogDescription(string description,DataType const &datatype) {
    37     description+=" ("+datatype.GetDescription()+")";
    38     descriptors.push_back(description);
     37void io_data_impl::AppendLogDescription(string description,
     38                                        DataType const &datatype) {
     39  description += " (" + datatype.GetDescription() + ")";
     40  descriptors.push_back(description);
    3941}
    4042
    41 void io_data_impl::WriteLogDescriptor(std::fstream& desc_file,int *index) {
    42     for(size_t i=0;i<descriptors.size();i++) {
    43         desc_file << (*index)++ << ": " << self->ObjectName() << " - " << descriptors.at(i) << "\n";
    44     }
     43void io_data_impl::WriteLogDescriptor(std::fstream &desc_file, int *index) {
     44  for (size_t i = 0; i < descriptors.size(); i++) {
     45    desc_file << (*index)++ << ": " << self->ObjectName() << " - "
     46              << descriptors.at(i) << "\n";
     47  }
    4548}
    4649
    4750void io_data_impl::PrintLogDescriptor(void) {
    48     for(size_t i=0;i<descriptors.size();i++) {
    49         Printf("    %s\n",descriptors.at(i).c_str());
    50     }
     51  for (size_t i = 0; i < descriptors.size(); i++) {
     52    Printf("    %s\n", descriptors.at(i).c_str());
     53  }
    5154}
    5255
    5356void io_data_impl::Circle(void) {
    54     if(n>1) {
    55         self->GetMutex();
     57  if (n > 1) {
     58    self->GetMutex();
    5659
    57         void* tmp=*self->Prev(n-1)->pimpl_->circle_ptr;
     60    void *tmp = *self->Prev(n - 1)->pimpl_->circle_ptr;
    5861
    59         for(int i=0;i<n-1;i++) {
    60             //printf("%i\n",i);
    61             *(self->Prev(n-1-i)->pimpl_->circle_ptr)=*(self->Prev(n-2-i)->pimpl_->circle_ptr);
    62             self->Prev(n-1-i)->pimpl_->is_consistent=self->Prev(n-2-i)->pimpl_->is_consistent;
    63             self->Prev(n-1-i)->pimpl_->time=self->Prev(n-2-i)->pimpl_->time;
    64         }
    65         *circle_ptr=tmp;
    66         is_consistent=false;
    67         self->ReleaseMutex();
    68 
     62    for (int i = 0; i < n - 1; i++) {
     63      // printf("%i\n",i);
     64      *(self->Prev(n - 1 - i)->pimpl_->circle_ptr) =
     65          *(self->Prev(n - 2 - i)->pimpl_->circle_ptr);
     66      self->Prev(n - 1 - i)->pimpl_->is_consistent =
     67          self->Prev(n - 2 - i)->pimpl_->is_consistent;
     68      self->Prev(n - 1 - i)->pimpl_->time = self->Prev(n - 2 - i)->pimpl_->time;
    6969    }
     70    *circle_ptr = tmp;
     71    is_consistent = false;
     72    self->ReleaseMutex();
     73  }
    7074}
    7175
    72 bool io_data_impl::IsConsistent(void) {
    73     return is_consistent;
    74 }
     76bool io_data_impl::IsConsistent(void) { return is_consistent; }
    7577
    76 void io_data_impl::SetConsistent(bool status) {
    77     is_consistent=status;
    78 }
     78void io_data_impl::SetConsistent(bool status) { is_consistent = status; }
Note: See TracChangeset for help on using the changeset viewer.