/* Generated by D:\OpenDDS2\DDS\bin\opendds_idl version 3.9 (ACE version 6.2a_p11) running on input file MyDemo.idl */
#include "MyDemoTypeSupportImpl.h"
#include <cstring>
#include <stdexcept>
#include "dds/CorbaSeq/OctetSeqTypeSupportImpl.h"
#include "dds/DCPS/BuiltInTopicUtils.h"
#include "dds/DCPS/ContentFilteredTopicImpl.h"
#include "dds/DCPS/FilterEvaluator.h"
#include "dds/DCPS/MultiTopicDataReader_T.h"
#include "dds/DCPS/PoolAllocator.h"
#include "dds/DCPS/PublicationInstance.h"
#include "dds/DCPS/PublisherImpl.h"
#include "dds/DCPS/Qos_Helper.h"
#include "dds/DCPS/RakeData.h"
#include "dds/DCPS/RakeResults_T.h"
#include "dds/DCPS/ReceivedDataElementList.h"
#include "dds/DCPS/Registered_Data_Types.h"
#include "dds/DCPS/Service_Participant.h"
#include "dds/DCPS/SubscriberImpl.h"
#include "dds/DCPS/Util.h"
#include "dds/DCPS/debug.h"
#include "dds/DdsDcpsDomainC.h"
/* Begin MODULE: CORBA */
/* End MODULE: CORBA */
/* Begin MODULE: MyDemo */
/* Begin TYPEDEF: Data */
namespace OpenDDS { namespace DCPS {
void gen_find_size(const MyDemo::Data& seq, size_t& size, size_t& padding)
{
ACE_UNUSED_ARG(seq);
ACE_UNUSED_ARG(size);
ACE_UNUSED_ARG(padding);
find_size_ulong(size, padding);
if (seq.length() == 0) {
return;
}
size += seq.length() * max_marshaled_size_octet();
}
bool operator<<(Serializer& strm, const MyDemo::Data& seq)
{
ACE_UNUSED_ARG(strm);
ACE_UNUSED_ARG(seq);
const CORBA::ULong length = seq.length();
if (!(strm << length)) {
return false;
}
if (length == 0) {
return true;
}
return strm.write_octet_array(seq.get_buffer(), length);
}
bool operator>>(Serializer& strm, MyDemo::Data& seq)
{
ACE_UNUSED_ARG(strm);
ACE_UNUSED_ARG(seq);
CORBA::ULong length;
if (!(strm >> length)) {
return false;
}
seq.length(length);
if (length == 0) {
return true;
}
return strm.read_octet_array(seq.get_buffer(), length);
}
} }
#ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE
namespace OpenDDS { namespace DCPS {
void gen_skip_over(Serializer& ser, MyDemo::Data*)
{
ACE_UNUSED_ARG(ser);
ACE_CDR::ULong length;
ser >> length;
ser.skip(length, 1);
}
} }
#endif
/* End TYPEDEF: Data */
/* Begin STRUCT: Pos */
namespace OpenDDS { namespace DCPS {
void gen_find_size(const MyDemo::Pos& stru, size_t& size, size_t& padding)
{
ACE_UNUSED_ARG(stru);
ACE_UNUSED_ARG(size);
ACE_UNUSED_ARG(padding);
if ((size + padding) % 4) {
padding += 4 - ((size + padding) % 4);
}
size += gen_max_marshaled_size(stru.pos_id);
if ((size + padding) % 4) {
padding += 4 - ((size + padding) % 4);
}
size += gen_max_marshaled_size(stru.pos_x);
if ((size + padding) % 4) {
padding += 4 - ((size + padding) % 4);
}
size += gen_max_marshaled_size(stru.pos_y);
gen_find_size(stru.pos_data, size, padding);
}
bool operator<<(Serializer& strm, const MyDemo::Pos& stru)
{
ACE_UNUSED_ARG(strm);
ACE_UNUSED_ARG(stru);
return (strm << stru.pos_id)
&& (strm << stru.pos_x)
&& (strm << stru.pos_y)
&& (strm << stru.pos_data);
}
bool operator>>(Serializer& strm, MyDemo::Pos& stru)
{
ACE_UNUSED_ARG(strm);
ACE_UNUSED_ARG(stru);
return (strm >> stru.pos_id)
&& (strm >> stru.pos_x)
&& (strm >> stru.pos_y)
&& (strm >> stru.pos_data);
}
bool gen_is_bounded_size(const MyDemo::Pos&)
{
return false;
}
size_t gen_max_marshaled_size(const MyDemo::Pos& stru, bool align)
{
ACE_UNUSED_ARG(stru);
ACE_UNUSED_ARG(align);
return 0;
}
bool gen_is_bounded_size(KeyOnly<const MyDemo::Pos>)
{
return true;
}
size_t gen_max_marshaled_size(KeyOnly<const MyDemo::Pos> stru, bool align)
{
ACE_UNUSED_ARG(stru);
ACE_UNUSED_ARG(align);
return 4;
}
void gen_find_size(KeyOnly<const MyDemo::Pos> stru, size_t& size, size_t& padding)
{
ACE_UNUSED_ARG(stru);
ACE_UNUSED_ARG(size);
ACE_UNUSED_ARG(padding);
if ((size + padding) % 4) {
padding += 4 - ((size + padding) % 4);
}
size += gen_max_marshaled_size(stru.t.pos_id);
}
bool operator<<(Serializer& strm, KeyOnly<const MyDemo::Pos> stru)
{
ACE_UNUSED_ARG(strm);
ACE_UNUSED_ARG(stru);
return (strm << stru.t.pos_id);
}
bool operator>>(Serializer& strm, KeyOnly<MyDemo::Pos> stru)
{
ACE_UNUSED_ARG(strm);
ACE_UNUSED_ARG(stru);
return (strm >> stru.t.pos_id);
}
} }
namespace OpenDDS { namespace DCPS {
bool gen_has_key(const MyDemo::Pos&)
{
return true;
}
} }
namespace MyDemo {
}
#ifndef OPENDDS_NO_CONTENT_SUBSCRIPTION_PROFILE
namespace OpenDDS { namespace DCPS {
template<>
struct MetaStructImpl<MyDemo::Pos> : MetaStruct {
typedef MyDemo::Pos T;
void* allocate() const { return new T; }
void deallocate(void* stru) const { delete static_cast<T*>(stru); }
size_t numDcpsKeys() const { return 1; }
Value getValue(const void* stru, const char* field) const
{
const MyDemo::Pos& typed = *static_cast<const MyDemo::Pos*>(stru);
if (std::strcmp(field, "pos_id") == 0) {
return typed.pos_id;
}
if (std::strcmp(field, "pos_x") == 0) {
return typed.pos_x;
}
if (std::strcmp(field, "pos_y") == 0) {
return typed.pos_y;
}
ACE_UNUSED_ARG(typed);
throw std::runtime_error("Field " + OPENDDS_STRING(field) + " not found or its type is not supported (in struct MyDemo::Pos)");
}
Value getValue(Serializer& ser, const char* field) const
{
if (std::strcmp(field, "pos_id") == 0) {
ACE_CDR::Long val;
if (!(ser >> val)) {
throw std::runtime_error("Field 'pos_id' could not be deserialized");
}
return val;
} else {
ser.skip(1, 4);
}
if (std::strcmp(field, "pos_x") == 0) {
ACE_CDR::Long val;
if (!(ser >> val)) {
throw std::runtime_error("Field 'pos_x' could not be deserialized");
}
return val;
} else {
ser.skip(1, 4);
}
if (std::strcmp(field, "pos_y") == 0) {
ACE_CDR::Long val;
if (!(ser >> val)) {
throw std::runtime_error("Field 'pos_y' could not be deserialized");
}
return val;
} else {
ser.skip(1, 4);
}
gen_skip_over(ser, static_cast<MyDemo::Data*>(0));
if (!field[0]) {
return 0;
}
throw std::runtime_error("Field " + OPENDDS_STRING(field) + " not valid for struct MyDemo::Pos");
}
ComparatorBase::Ptr create_qc_comparator(const char* field, ComparatorBase::Ptr next) const
{
ACE_UNUSED_ARG(next);
if (std::strcmp(field, "pos_id") == 0) {
return make_field_cmp(&T::pos_id, next);
}
if (std::strcmp(field, "pos_x") == 0) {
return make_field_cmp(&T::pos_x, next);
}
if (std::strcmp(field, "pos_y") == 0) {
return make_field_cmp(&T::pos_y, next);
}
throw std::runtime_error("Field " + OPENDDS_STRING(field) + " not found or its type is not supported (in struct MyDemo::Pos)");
}
const char** getFieldNames() const
{
static const char* names[] = {"pos_id", "pos_x", "pos_y", "pos_data", 0};
return names;
}
const void* getRawField(const void* stru, const char* field) const
{
if (std::strcmp(field, "pos_id") == 0) {
return &static_cast<const T*>(stru)->pos_id;
}
if (std::strcmp(field, "pos_x") == 0) {
return &static_cast<const T*>(stru)->pos_x;
}
if (std::strcmp(field, "pos_y") == 0) {
return &static_cast<const T*>(stru)->pos_y;
}
if (std::strcmp(field, "pos_data") == 0) {
return &static_cast<const T*>(stru)->pos_data;
}
throw std::runtime_error("Field " + OPENDDS_STRING(field) + " not found or its type is not supported (in struct MyDemo::Pos)");
}
void assign(void* lhs, const char* field, const void* rhs,
const char* rhsFieldSpec, const MetaStruc
没有合适的资源?快使用搜索试试~ 我知道了~
OpenDDS 测试案例

共90个文件
tlog:21个
obj:13个
cpp:8个


温馨提示
本程序实现发布端/订阅端之间通信,双界面实现效果,能给加深刻的了解发布和订阅实现过程;
资源推荐
资源详情
资源评论







收起资源包目录






































































































共 90 条
- 1
资源评论

- 湯姆漢克2023-07-25这份文件内容简洁、实用,对于想要通过OpenDDS进行测试的人来说是一个不错的参考资料。
- 莫少儒2023-07-25这篇文件以简洁明了的语言介绍了一些OpenDDS测试案例,用于帮助开发人员快速入门。
- 郑华滨2023-07-25对于想要深入了解OpenDDS并进行测试的开发者来说,这个文件提供了一些简单但实用的测试案例。
- 鲸阮2023-07-25这个文件介绍了一些OpenDDS测试案例,虽然没有特别突出的亮点,但对理解和学习OpenDDS有一定帮助。
- 深层动力2023-07-25这篇文件提供了一些实用的OpenDDS测试案例,帮助我更好地了解和应用这个工具。

No.10-11
- 粉丝: 1
- 资源: 17
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


安全验证
文档复制为VIP权益,开通VIP直接复制
