RTI Connext Modern C++ API  Version 7.0.0
Foo.hpp

The definition of the C++ types create from Foo.idl

See also
Working with IDL types
/*
WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY.
This file was generated from Foo.idl
using RTI Code Generator (rtiddsgen) version 4.0.0.
The rtiddsgen tool is part of the RTI Connext DDS distribution.
For more information, type 'rtiddsgen -help' at a command shell
or consult the Code Generator User's Manual.
*/
#ifndef Foo_982570024_hpp
#define Foo_982570024_hpp
#include <iosfwd>
#if (defined(RTI_WIN32) || defined (RTI_WINCE) || defined(RTI_INTIME)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, start exporting symbols.
*/
#undef RTIUSERDllExport
#define RTIUSERDllExport __declspec(dllexport)
#endif
#include "dds/domain/DomainParticipant.hpp"
#include "dds/topic/TopicTraits.hpp"
#include "dds/core/SafeEnumeration.hpp"
#include "dds/core/String.hpp"
#include "dds/core/array.hpp"
#include "dds/core/vector.hpp"
#include "dds/core/Optional.hpp"
#include "dds/core/xtypes/DynamicType.hpp"
#include "dds/core/xtypes/StructType.hpp"
#include "dds/core/xtypes/UnionType.hpp"
#include "dds/core/xtypes/EnumType.hpp"
#include "dds/core/xtypes/AliasType.hpp"
#include "rti/core/array.hpp"
#include "rti/core/BoundedSequence.hpp"
#include "rti/util/StreamFlagSaver.hpp"
#include "rti/domain/PluginSupport.hpp"
#include "rti/core/LongDouble.hpp"
#include "dds/core/External.hpp"
#include "rti/core/Pointer.hpp"
#include "rti/topic/TopicTraits.hpp"
#if (defined(RTI_WIN32) || defined (RTI_WINCE) || defined(RTI_INTIME)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef RTIUSERDllExport
#define RTIUSERDllExport
#endif
#if (defined(RTI_WIN32) || defined (RTI_WINCE) || defined(RTI_INTIME)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, start exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport __declspec(dllexport)
#endif
class NDDSUSERDllExport Foo {
public:
Foo();
Foo(int32_t x,int32_t y);
#ifdef RTI_CXX11_RVALUE_REFERENCES
#ifndef RTI_CXX11_NO_IMPLICIT_MOVE_OPERATIONS
Foo (Foo&&) = default;
Foo& operator=(Foo&&) = default;
Foo& operator=(const Foo&) = default;
Foo(const Foo&) = default;
#else
Foo(Foo&& other_) OMG_NOEXCEPT;
Foo& operator=(Foo&& other_) OMG_NOEXCEPT;
#endif
#endif
int32_t& x() OMG_NOEXCEPT {
return m_x_;
}
const int32_t& x() const OMG_NOEXCEPT {
return m_x_;
}
void x(int32_t value) {
m_x_ = value;
}
int32_t& y() OMG_NOEXCEPT {
return m_y_;
}
const int32_t& y() const OMG_NOEXCEPT {
return m_y_;
}
void y(int32_t value) {
m_y_ = value;
}
bool operator == (const Foo& other_) const;
bool operator != (const Foo& other_) const;
void swap(Foo& other_) OMG_NOEXCEPT ;
private:
int32_t m_x_;
int32_t m_y_;
};
inline void swap(Foo& a, Foo& b) OMG_NOEXCEPT
{
a.swap(b);
}
NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const Foo& sample);
#if (defined(RTI_WIN32) || defined (RTI_WINCE)) && defined(NDDS_USER_DLL_EXPORT)
// On Windows, dll-export template instantiations of standard types used by
// other dll-exported types
template class NDDSUSERDllExport std::allocator< int32_t >;
template class NDDSUSERDllExport std::vector< int32_t >;
#endif
class NDDSUSERDllExport MyType {
public:
MyType();
MyType(int32_t my_long,const std::string& my_string,const Foo& my_foo,const ::rti::core::bounded_sequence< int32_t, 10L >& my_sequence,const ::dds::core::array< Foo, 5L>& my_array,const ::dds::core::optional< Foo >& my_optional);
#ifdef RTI_CXX11_RVALUE_REFERENCES
#ifndef RTI_CXX11_NO_IMPLICIT_MOVE_OPERATIONS
MyType (MyType&&) = default;
MyType& operator=(MyType&&) = default;
MyType& operator=(const MyType&) = default;
MyType(const MyType&) = default;
#else
MyType(MyType&& other_) OMG_NOEXCEPT;
MyType& operator=(MyType&& other_) OMG_NOEXCEPT;
#endif
#endif
int32_t& my_long() OMG_NOEXCEPT {
return m_my_long_;
}
const int32_t& my_long() const OMG_NOEXCEPT {
return m_my_long_;
}
void my_long(int32_t value) {
m_my_long_ = value;
}
std::string& my_string() OMG_NOEXCEPT {
return m_my_string_;
}
const std::string& my_string() const OMG_NOEXCEPT {
return m_my_string_;
}
void my_string(const std::string& value) {
m_my_string_ = value;
}
void my_string(std::string&& value) {
m_my_string_ = std::move(value);
}
Foo& my_foo() OMG_NOEXCEPT {
return m_my_foo_;
}
const Foo& my_foo() const OMG_NOEXCEPT {
return m_my_foo_;
}
void my_foo(const Foo& value) {
m_my_foo_ = value;
}
void my_foo(Foo&& value) {
m_my_foo_ = std::move(value);
}
::rti::core::bounded_sequence< int32_t, 10L >& my_sequence() OMG_NOEXCEPT {
return m_my_sequence_;
}
const ::rti::core::bounded_sequence< int32_t, 10L >& my_sequence() const OMG_NOEXCEPT {
return m_my_sequence_;
}
void my_sequence(const ::rti::core::bounded_sequence< int32_t, 10L >& value) {
m_my_sequence_ = value;
}
void my_sequence(::rti::core::bounded_sequence< int32_t, 10L >&& value) {
m_my_sequence_ = std::move(value);
}
::dds::core::array< Foo, 5L>& my_array() OMG_NOEXCEPT {
return m_my_array_;
}
const ::dds::core::array< Foo, 5L>& my_array() const OMG_NOEXCEPT {
return m_my_array_;
}
void my_array(const ::dds::core::array< Foo, 5L>& value) {
m_my_array_ = value;
}
void my_array(::dds::core::array< Foo, 5L>&& value) {
m_my_array_ = std::move(value);
}
::dds::core::optional< Foo >& my_optional() OMG_NOEXCEPT {
return m_my_optional_;
}
const ::dds::core::optional< Foo >& my_optional() const OMG_NOEXCEPT {
return m_my_optional_;
}
void my_optional(const ::dds::core::optional< Foo >& value) {
m_my_optional_ = value;
}
void my_optional(::dds::core::optional< Foo >&& value) {
m_my_optional_ = std::move(value);
}
bool operator == (const MyType& other_) const;
bool operator != (const MyType& other_) const;
void swap(MyType& other_) OMG_NOEXCEPT ;
private:
int32_t m_my_long_;
std::string m_my_string_;
Foo m_my_foo_;
::dds::core::array< Foo, 5L> m_my_array_;
};
inline void swap(MyType& a, MyType& b) OMG_NOEXCEPT
{
a.swap(b);
}
NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const MyType& sample);
enum class Color {
RED,
GREEN,
BLUE
};
NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const Color& sample);
enum class MyUnionDiscriminator {
USE_LONG,
USE_STRING,
USE_FOO
};
NDDSUSERDllExport std::ostream& operator << (std::ostream& o,const MyUnionDiscriminator& sample);
class NDDSUSERDllExport MyUnion {
public:
MyUnion();
#ifdef RTI_CXX11_RVALUE_REFERENCES
#ifndef RTI_CXX11_NO_IMPLICIT_MOVE_OPERATIONS
MyUnion (MyUnion&&) = default;
MyUnion& operator=(MyUnion&&) = default;
MyUnion& operator=(const MyUnion&) = default;
MyUnion(const MyUnion&) = default;
#else
MyUnion(MyUnion&& other_) OMG_NOEXCEPT;
MyUnion& operator=(MyUnion&& other_) OMG_NOEXCEPT;
#endif
#endif
MyUnionDiscriminator& _d() OMG_NOEXCEPT {
return m_d_;
}
const MyUnionDiscriminator& _d() const OMG_NOEXCEPT {
return m_d_;
}
void _d(const MyUnionDiscriminator& value) {
m_d_ = value;
}
int32_t& my_long() {
if ( _d() != (MyUnionDiscriminator::USE_LONG)) {
throw ::dds::core::PreconditionNotMetError(
"MyUnion::my_long not selected by the discriminator" );
}
return m_u_.m_my_long_;
}
const int32_t& my_long() const {
if ( _d() != (MyUnionDiscriminator::USE_LONG)) {
throw ::dds::core::PreconditionNotMetError(
"MyUnion::my_long not selected by the discriminator" );
}
return m_u_.m_my_long_;
}
void my_long(int32_t value) {
m_u_.m_my_long_ = value;
m_d_= (MyUnionDiscriminator::USE_LONG);
}
std::string& my_string() {
if ( _d() != (MyUnionDiscriminator::USE_STRING)) {
throw ::dds::core::PreconditionNotMetError(
"MyUnion::my_string not selected by the discriminator" );
}
return m_u_.m_my_string_;
}
const std::string& my_string() const {
if ( _d() != (MyUnionDiscriminator::USE_STRING)) {
throw ::dds::core::PreconditionNotMetError(
"MyUnion::my_string not selected by the discriminator" );
}
return m_u_.m_my_string_;
}
void my_string(const std::string& value) {
m_u_.m_my_string_ = value;
m_d_= (MyUnionDiscriminator::USE_STRING);
}
void my_string(std::string&& value) {
m_u_.m_my_string_ = std::move(value);
m_d_= (MyUnionDiscriminator::USE_STRING);
}
Foo& my_foo() {
if ( _d() != (MyUnionDiscriminator::USE_FOO)) {
throw ::dds::core::PreconditionNotMetError(
"MyUnion::my_foo not selected by the discriminator" );
}
return m_u_.m_my_foo_;
}
const Foo& my_foo() const {
if ( _d() != (MyUnionDiscriminator::USE_FOO)) {
throw ::dds::core::PreconditionNotMetError(
"MyUnion::my_foo not selected by the discriminator" );
}
return m_u_.m_my_foo_;
}
void my_foo(const Foo& value) {
m_u_.m_my_foo_ = value;
m_d_= (MyUnionDiscriminator::USE_FOO);
}
void my_foo(Foo&& value) {
m_u_.m_my_foo_ = std::move(value);
m_d_= (MyUnionDiscriminator::USE_FOO);
}
bool operator == (const MyUnion& other_) const;
bool operator != (const MyUnion& other_) const;
static MyUnionDiscriminator default_discriminator();
void swap(MyUnion& other_) OMG_NOEXCEPT ;
private:
MyUnionDiscriminator m_d_;
struct NDDSUSERDllExport Union_ {
int32_t m_my_long_;
std::string m_my_string_;
Foo m_my_foo_;
Union_();
Union_(int32_t my_long,const std::string& my_string,const Foo& my_foo);
};
Union_ m_u_;
};
inline void swap(MyUnion& a, MyUnion& b) OMG_NOEXCEPT
{
a.swap(b);
}
NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const MyUnion& sample);
class NDDSUSERDllExport MyOtherType {
public:
MyOtherType();
MyOtherType(int32_t m1,double m2,const std::string& m3);
#ifdef RTI_CXX11_RVALUE_REFERENCES
#ifndef RTI_CXX11_NO_IMPLICIT_MOVE_OPERATIONS
MyOtherType (MyOtherType&&) = default;
MyOtherType& operator=(MyOtherType&&) = default;
MyOtherType& operator=(const MyOtherType&) = default;
MyOtherType(const MyOtherType&) = default;
#else
MyOtherType(MyOtherType&& other_) OMG_NOEXCEPT;
MyOtherType& operator=(MyOtherType&& other_) OMG_NOEXCEPT;
#endif
#endif
int32_t& m1() OMG_NOEXCEPT {
return m_m1_;
}
const int32_t& m1() const OMG_NOEXCEPT {
return m_m1_;
}
void m1(int32_t value) {
m_m1_ = value;
}
double& m2() OMG_NOEXCEPT {
return m_m2_;
}
const double& m2() const OMG_NOEXCEPT {
return m_m2_;
}
void m2(double value) {
m_m2_ = value;
}
std::string& m3() OMG_NOEXCEPT {
return m_m3_;
}
const std::string& m3() const OMG_NOEXCEPT {
return m_m3_;
}
void m3(const std::string& value) {
m_m3_ = value;
}
void m3(std::string&& value) {
m_m3_ = std::move(value);
}
bool operator == (const MyOtherType& other_) const;
bool operator != (const MyOtherType& other_) const;
void swap(MyOtherType& other_) OMG_NOEXCEPT ;
private:
int32_t m_m1_;
double m_m2_;
std::string m_m3_;
};
inline void swap(MyOtherType& a, MyOtherType& b) OMG_NOEXCEPT
{
a.swap(b);
}
NDDSUSERDllExport std::ostream& operator<<(std::ostream& o, const MyOtherType& sample);
namespace rti {
namespace flat {
namespace topic {
}
}
}
namespace dds {
namespace topic {
template<>
struct topic_type_name< Foo > {
NDDSUSERDllExport static std::string value() {
return "Foo";
}
};
template<>
struct is_topic_type< Foo > : public ::dds::core::true_type {};
template<>
struct topic_type_support< Foo > {
NDDSUSERDllExport
static void register_type(
const std::string & type_name);
NDDSUSERDllExport
static std::vector<char>& to_cdr_buffer(
std::vector<char>& buffer,
const Foo& sample,
NDDSUSERDllExport
static void from_cdr_buffer(Foo& sample, const std::vector<char>& buffer);
NDDSUSERDllExport
static void reset_sample(Foo& sample);
NDDSUSERDllExport
static void allocate_sample(Foo& sample, int, int);
static const ::rti::topic::TypePluginKind::type type_plugin_kind =
::rti::topic::TypePluginKind::STL;
};
template<>
struct topic_type_name< MyType > {
NDDSUSERDllExport static std::string value() {
return "MyType";
}
};
template<>
struct is_topic_type< MyType > : public ::dds::core::true_type {};
template<>
struct topic_type_support< MyType > {
NDDSUSERDllExport
static void register_type(
const std::string & type_name);
NDDSUSERDllExport
static std::vector<char>& to_cdr_buffer(
std::vector<char>& buffer,
const MyType& sample,
NDDSUSERDllExport
static void from_cdr_buffer(MyType& sample, const std::vector<char>& buffer);
NDDSUSERDllExport
static void reset_sample(MyType& sample);
NDDSUSERDllExport
static void allocate_sample(MyType& sample, int, int);
static const ::rti::topic::TypePluginKind::type type_plugin_kind =
::rti::topic::TypePluginKind::STL;
};
template<>
struct topic_type_name< MyUnion > {
NDDSUSERDllExport static std::string value() {
return "MyUnion";
}
};
template<>
struct is_topic_type< MyUnion > : public ::dds::core::true_type {};
template<>
struct topic_type_support< MyUnion > {
NDDSUSERDllExport
static void register_type(
const std::string & type_name);
NDDSUSERDllExport
static std::vector<char>& to_cdr_buffer(
std::vector<char>& buffer,
const MyUnion& sample,
NDDSUSERDllExport
static void from_cdr_buffer(MyUnion& sample, const std::vector<char>& buffer);
NDDSUSERDllExport
static void reset_sample(MyUnion& sample);
NDDSUSERDllExport
static void allocate_sample(MyUnion& sample, int, int);
static const ::rti::topic::TypePluginKind::type type_plugin_kind =
::rti::topic::TypePluginKind::STL;
};
template<>
struct topic_type_name< MyOtherType > {
NDDSUSERDllExport static std::string value() {
return "MyOtherType";
}
};
template<>
struct is_topic_type< MyOtherType > : public ::dds::core::true_type {};
template<>
struct topic_type_support< MyOtherType > {
NDDSUSERDllExport
static void register_type(
const std::string & type_name);
NDDSUSERDllExport
static std::vector<char>& to_cdr_buffer(
std::vector<char>& buffer,
const MyOtherType& sample,
NDDSUSERDllExport
static void from_cdr_buffer(MyOtherType& sample, const std::vector<char>& buffer);
NDDSUSERDllExport
static void reset_sample(MyOtherType& sample);
NDDSUSERDllExport
static void allocate_sample(MyOtherType& sample, int, int);
static const ::rti::topic::TypePluginKind::type type_plugin_kind =
::rti::topic::TypePluginKind::STL;
};
}
}
namespace rti {
namespace topic {
#ifndef NDDS_STANDALONE_TYPE
template<>
struct dynamic_type< Foo > {
typedef ::dds::core::xtypes::StructType type;
NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get();
};
#endif
template <>
struct extensibility< Foo > {
static const ::dds::core::xtypes::ExtensibilityKind::type kind =
::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; };
#ifndef NDDS_STANDALONE_TYPE
template<>
struct dynamic_type< MyType > {
typedef ::dds::core::xtypes::StructType type;
NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get();
};
#endif
template <>
struct extensibility< MyType > {
static const ::dds::core::xtypes::ExtensibilityKind::type kind =
::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; };
#ifndef NDDS_STANDALONE_TYPE
template <>
struct default_enumerator<Color>
{
static const Color value;
};
template<>
struct dynamic_type< Color > {
typedef ::dds::core::xtypes::EnumType type;
NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get();
};
#endif
template <>
struct extensibility< Color > {
static const ::dds::core::xtypes::ExtensibilityKind::type kind =
::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; };
#ifndef NDDS_STANDALONE_TYPE
template <>
struct default_enumerator<MyUnionDiscriminator>
{
static const MyUnionDiscriminator value;
};
template<>
struct dynamic_type< MyUnionDiscriminator > {
typedef ::dds::core::xtypes::EnumType type;
NDDSUSERDllExport static const ::dds::core::xtypes::EnumType& get();
};
#endif
template <>
struct extensibility< MyUnionDiscriminator > {
static const ::dds::core::xtypes::ExtensibilityKind::type kind =
::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; };
#ifndef NDDS_STANDALONE_TYPE
template<>
struct dynamic_type< MyUnion > {
typedef ::dds::core::xtypes::UnionType type;
NDDSUSERDllExport static const ::dds::core::xtypes::UnionType& get();
};
#endif
template <>
struct extensibility< MyUnion > {
static const ::dds::core::xtypes::ExtensibilityKind::type kind =
::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; };
#ifndef NDDS_STANDALONE_TYPE
template<>
struct dynamic_type< MyOtherType > {
typedef ::dds::core::xtypes::StructType type;
NDDSUSERDllExport static const ::dds::core::xtypes::StructType& get();
};
#endif
template <>
struct extensibility< MyOtherType > {
static const ::dds::core::xtypes::ExtensibilityKind::type kind =
::dds::core::xtypes::ExtensibilityKind::EXTENSIBLE; };
}
}
#if (defined(RTI_WIN32) || defined (RTI_WINCE) || defined(RTI_INTIME)) && defined(NDDS_USER_DLL_EXPORT)
/* If the code is building on Windows, stop exporting symbols.
*/
#undef NDDSUSERDllExport
#define NDDSUSERDllExport
#endif
#endif // Foo_982570024_hpp