MessageMemberPointer.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (C) 2014 by Ralf Kaestner *
3  * ralf.kaestner@gmail.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the Lesser GNU General Public License as published by*
7  * the Free Software Foundation; either version 3 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * Lesser GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the Lesser GNU General Public License *
16  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17  ******************************************************************************/
18 
23 #ifndef VARIANT_TOPIC_TOOLS_MESSAGE_MEMBER_POINTER_H
24 #define VARIANT_TOPIC_TOOLS_MESSAGE_MEMBER_POINTER_H
25 
29 
30 namespace variant_topic_tools {
33  template <typename T, typename M> class MessageMemberPointer :
34  public Pointer<typename type_traits::DataType<M>::ValueType> {
35  public:
37 
41 
45 
48  MessageMemberPointer(ValueType* message = 0, size_t offset = 0);
49 
53  MessageMemberPointer(const Pointer<ValueType>& message, size_t offset);
54 
58 
62 
66 
69  void setMessage(const Pointer<ValueType>& message);
70 
73  const Pointer<ValueType>& getMessage() const;
74 
77  void setOffset(size_t offset);
78 
81  size_t getOffset() const;
82 
83  protected:
86  class Impl :
87  public Pointer<MemberValueType>::ImplA {
88  public:
92  offset = 0);
93 
96  virtual ~Impl();
97 
100  MemberValueType* get() const;
101 
105 
108  size_t offset;
109  };
110  };
111 };
112 
113 #include <variant_topic_tools/MessageMemberPointer.tpp>
114 
115 #endif
MessageMemberPointer(ValueType *message=0, size_t offset=0)
Default constructor.
void setMessage(const Pointer< ValueType > &message)
Set the message.
size_t getOffset() const
Retrieve the message member offset.
Impl(const Pointer< ValueType > &message=Pointer< ValueType >(), size_t offset=0)
Constructor.
void setOffset(size_t offset)
Set the message member offset.
const Pointer< ValueType > & getMessage() const
Retrieve the message.
Header file providing the data type traits.
BOOST_STATIC_ASSERT(type_traits::IsMessage< T >::value)
Pointer< ValueType > message
The shared message.
type_traits::MessageType< T >::ValueType ValueType
Definition of the message value type.
Shared pointer.
Definition: Pointer.h:33
Header file providing the message type traits.
Message member pointer implementation.
Header file providing the Pointer class interface.
type_traits::DataType< M >::ValueType MemberValueType
Definition of the message member value type.


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Sat Jan 9 2021 03:56:49