11 #if !defined (__ACE_INLINE__) 20 template<
typename DatumType>
25 template<
typename DatumType>
29 if (this->onFull_ == Unbounded) {
30 this->buffer_.push_back(datum);
35 if (this->writeAt_ != this->bound_) {
36 this->buffer_[ this->writeAt_++] = datum;
39 if (this->writeAt_ == this->bound_) {
42 if (this->onFull_ == KeepNewest) {
50 template<
typename DatumType>
54 if (this->onFull_ == Unbounded)
return static_cast<unsigned int>(this->buffer_.size());
56 else if (this->full_)
return this->bound_;
58 else return this->writeAt_;
61 #ifndef OPENDDS_SAFETY_PROFILE 62 template<
typename DatumType>
66 std::ofstream initStrState;
67 initStrState.copyfmt(str);
70 str << std::scientific;
74 for (
unsigned int index = this->writeAt_; index < this->bound_; ++index) {
75 str << this->buffer_[ index] << std::endl;
80 int end = this->writeAt_;
84 end =
static_cast<int>(this->buffer_.size());
88 for (
int index = 0; index < end; ++index) {
89 str << this->buffer_[ index] << std::endl;
92 str.copyfmt(initStrState);
95 #endif //OPENDDS_SAFETY_PROFILE unsigned int size() const
Amount of data actually stored.
void collect(const DatumType &datum)
Implement data collection.
virtual ~DataCollector()
Allow the class to be extended.
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
std::ostream & insert(std::ostream &str) const
Implement insertion of collected data onto an ostream.