RTI Connext Modern C++ API  Version 6.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
rti::core::Cookie Class Reference

Unique identifier for a written data sample in the form of a sequence of bytes. More...

#include <rti/core/Cookie.hpp>

Public Member Functions

 Cookie ()
 Creates an empty cookie.
 
template<typename ByteContainer >
 Cookie (const ByteContainer &bytes)
 Creates a new cookie with the bytes inside a container.
 
dds::core::vector< uint8_t > & value ()
 Retrieves a reference to the vector of bytes.
 
const dds::core::vector
< uint8_t > & 
value () const
 Retrieves a const reference to the vector of bytes.
 
template<typename T >
T * to_pointer () const
 Converts a cookie into a pointer.
 

Related Functions

(Note that these are not member functions.)

typedef dds::core::vector< CookieCookieSeq
 A sequence of Cookie objects.
 
std::ostream & operator<< (std::ostream &out, const Cookie &cookie)
 Prints a Cookie to an output stream.
 

Detailed Description

Unique identifier for a written data sample in the form of a sequence of bytes.

See Also
dds::pub::DataWriter::write(const T&, rti::pub::WriteParams&)

Constructor & Destructor Documentation

rti::core::Cookie::Cookie ( )
inline

Creates an empty cookie.

template<typename ByteContainer >
rti::core::Cookie::Cookie ( const ByteContainer &  bytes)
inlineexplicit

Creates a new cookie with the bytes inside a container.

Member Function Documentation

dds::core::vector<uint8_t>& rti::core::Cookie::value ( )

Retrieves a reference to the vector of bytes.

const dds::core::vector<uint8_t>& rti::core::Cookie::value ( ) const

Retrieves a const reference to the vector of bytes.

template<typename T >
T* rti::core::Cookie::to_pointer ( ) const
inline

Converts a cookie into a pointer.

Utility function that allows retrieving a pointer stored in a cookie.

Precondition
The cookie's value was filled with a pointer, otherwise the value returned may not be a valid memory address.
Template Parameters
TThe pointer type
Returns
The pointer this cookie represents

Friends And Related Function Documentation

A sequence of Cookie objects.

std::ostream & operator<< ( std::ostream &  out,
const Cookie cookie 
)
related

Prints a Cookie to an output stream.


RTI Connext Modern C++ API Version 6.0.1 Copyright © Sat Nov 23 2019 Real-Time Innovations, Inc