00001 /* 00002 * 00003 * 00004 * Distributed under the OpenDDS License. 00005 * See: http://www.opendds.org/license.html 00006 */ 00007 00008 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 00009 00010 namespace OpenDDS { 00011 namespace DCPS { 00012 00013 #ifndef OPENDDS_SAFETY_PROFILE 00014 template<typename DatumType> 00015 ACE_INLINE 00016 std::ostream& operator<<( 00017 std::ostream& str, 00018 const DataCollector<DatumType>& value) 00019 { 00020 return value.insert(str); 00021 } 00022 #endif //OPENDDS_SAFETY_PROFILE 00023 00024 template<typename DatumType> 00025 ACE_INLINE 00026 DataCollector<DatumType>::DataCollector(unsigned int bound, OnFull onFull) 00027 : buffer_(bound), 00028 writeAt_(0), 00029 bound_(bound), 00030 full_(false), 00031 onFull_(onFull) 00032 { 00033 if (this->onFull_ == Unbounded) { 00034 this->buffer_.clear(); 00035 } 00036 } 00037 00038 #ifndef OPENDDS_SAFETY_PROFILE 00039 template<typename DatumType> 00040 ACE_INLINE 00041 DataCollector<DatumType>& 00042 DataCollector<DatumType>::operator<<(DatumType datum) 00043 { 00044 this->collect(datum); 00045 return *this; 00046 } 00047 #endif //OPENDDS_SAFETY_PROFILE 00048 00049 } // namespace DCPS 00050 } // namespace OpenDDS 00051 00052 OPENDDS_END_VERSIONED_NAMESPACE_DECL