• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/hpp/dds/topic/detail/ContentFilteredTopic.hpp

Go to the documentation of this file.
00001 #ifndef OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_
00002 #define OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_
00003 
00004 /* Copyright 2010, Object Management Group, Inc.
00005  * Copyright 2010, PrismTech, Inc.
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 <string>
00023 #include <vector>
00024 
00025 #include <dds/core/detail/conformance.hpp>
00026 #include <dds/core/types.hpp>
00027 #include <dds/topic/detail/topicfwd.hpp>
00028 #include <idds/topic/TopicDescription.hpp>
00029 #include <dds/topic/Topic.hpp>
00030 
00031 
00032 namespace dds { namespace topic { namespace detail {
00033 
00034 #ifdef OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
00035 
00036 template <typename T>
00037 class ContentFilteredTopic  : public idds::topic::TopicDescriptionImpl<T>
00038 {
00039 public:
00040     ContentFilteredTopic(const std::string& the_name,
00041                          const dds::topic::Topic<T>& the_topic,
00042                          const std::string& filter,
00043                          const dds::core::StringSeq& parameters,
00044                          const typename idds::topic::TopicDescriptionImpl<T>::DPHolder& dp)
00045     : idds::topic::TopicDescriptionImpl<T>(the_name,
00046                                            the_topic.type_name(),
00047                                            dp),
00048       topic_(the_topic),
00049       filter_(filter),
00050       params_(parameters) { }
00051 
00052         virtual ~ContentFilteredTopic() { }
00053 
00054 public:
00055     const std::string& filter_expression() const {
00056                 return filter_;
00057         }
00058 
00059     const dds::core::StringSeq expression_parameters() const {
00060                 return params_;
00061         }
00062 
00063     void expression_parameters(const dds::core::StringSeq& params) {
00064                 params_ = params;
00065         }
00066 
00067         dds::topic::Topic<T> topic() const {
00068                 return topic_;
00069         }
00070 
00071 private:
00072         dds::topic::Topic<T> topic_;
00073         std::string             filter_;
00074         std::vector<std::string> params_;
00075 
00076 };
00077 
00078 #endif  // OMG_DDS_CONTENT_SUBSCRIPTION_SUPPORT
00079 
00080 } } }
00081 
00082 
00083 #endif /* OMG_DDS_TOPIC_DETAIL_CONTENTFILTEREDTOPIC_HPP_ */

Generated on Tue Nov 9 2010 02:16:21 for dds-psm-cxx-doc by  doxygen 1.7.1