Changeset 15 in flair-src for trunk/lib/FlairCore/src/io_data_impl.cpp
- Timestamp:
- 04/08/16 15:40:57 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/FlairCore/src/io_data_impl.cpp
r2 r15 23 23 using namespace flair::core; 24 24 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; 25 io_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; 32 33 } 33 34 34 35 io_data_impl::~io_data_impl() {} 35 36 36 void io_data_impl::AppendLogDescription(string description,DataType const &datatype) { 37 description+=" ("+datatype.GetDescription()+")"; 38 descriptors.push_back(description); 37 void io_data_impl::AppendLogDescription(string description, 38 DataType const &datatype) { 39 description += " (" + datatype.GetDescription() + ")"; 40 descriptors.push_back(description); 39 41 } 40 42 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 } 43 void 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 } 45 48 } 46 49 47 50 void 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 } 51 54 } 52 55 53 56 void io_data_impl::Circle(void) { 54 if(n>1) {55 57 if (n > 1) { 58 self->GetMutex(); 56 59 57 void* tmp=*self->Prev(n-1)->pimpl_->circle_ptr;60 void *tmp = *self->Prev(n - 1)->pimpl_->circle_ptr; 58 61 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; 69 69 } 70 *circle_ptr = tmp; 71 is_consistent = false; 72 self->ReleaseMutex(); 73 } 70 74 } 71 75 72 bool io_data_impl::IsConsistent(void) { 73 return is_consistent; 74 } 76 bool io_data_impl::IsConsistent(void) { return is_consistent; } 75 77 76 void io_data_impl::SetConsistent(bool status) { 77 is_consistent=status; 78 } 78 void io_data_impl::SetConsistent(bool status) { is_consistent = status; }
Note:
See TracChangeset
for help on using the changeset viewer.