00001 #ifndef OMG_DDS_PUB_DETAIL_SAMPLE_HPP_ 00002 #define OMG_DDS_PUB_DETAIL_SAMPLE_HPP_ 00003 00004 /* Copyright 2010, Object Management Group, Inc. 00005 * Copyright 2010, PrismTech, Corp. 00006 * Copyright 2010, Real-Time Innovations, Inc. 00007 * All rights reserved. 00008 * 00009 * Licensed under the Apache License, Version 2.0 (the "License"); 00010 * you may not use this file except in compliance with the License. 00011 * You may obtain a copy of the License at 00012 * 00013 * http://www.apache.org/licenses/LICENSE-2.0 00014 * 00015 * Unless required by applicable law or agreed to in writing, software 00016 * distributed under the License is distributed on an "AS IS" BASIS, 00017 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00018 * See the License for the specific language governing permissions and 00019 * limitations under the License. 00020 */ 00021 00022 #include <dds/core/corefwd.hpp> 00023 #include <dds/core/Exception.hpp> 00024 #include <dds/core/Time.hpp> 00025 #include <dds/sub/detail/subfwd.hpp> 00026 #include <dds/sub/status/ReaderState.hpp> 00027 00028 00029 namespace dds { namespace sub { namespace detail { 00030 00031 class GenerationCount { 00032 public: 00033 inline int32_t disposed() const { 00034 return 0; 00035 } 00036 00037 inline int32_t no_writers() const { 00038 return 0; 00039 } 00040 }; 00041 00042 00043 class Rank { 00044 public: 00045 inline int32_t absolute_generation() const { 00046 return 0; 00047 } 00048 00049 inline int32_t generation() const { 00050 return 0; 00051 } 00052 00053 inline int32_t sample() const { 00054 return 0; 00055 } 00056 }; 00057 00058 00059 class SampleInfo { 00060 public: 00061 inline const dds::core::Time timestamp() const { 00062 return dds::core::Time(); 00063 } 00064 00065 inline const dds::sub::status::ReaderState state() const { 00066 return dds::sub::status::ReaderState::any(); 00067 } 00068 00069 inline const GenerationCount generation_count() const { 00070 return GenerationCount(); 00071 } 00072 00073 inline const Rank rank() const { 00074 return Rank(); 00075 } 00076 00077 inline bool valid() const { 00078 return false; 00079 } 00080 }; 00081 00082 00083 template <typename T> 00084 class Sample { 00085 public: 00086 const T& data() const { 00087 throw dds::core::InvalidDataError("sample has no valid data"); 00088 } 00089 00090 const SampleInfo& info() const { 00091 return info_; 00092 } 00093 00094 private: 00095 SampleInfo info_; 00096 }; 00097 00098 00099 template <typename T> 00100 class LoanedSamples { }; 00101 } } } 00102 00103 00104 #endif /* OMG_DDS_PUB_DETAIL_SAMPLE_HPP_ */
1.7.1