diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-08-16 20:41:22 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2009-08-16 20:41:22 +0000 |
commit | 3b37923a14c7db4d9d602cd9166be38f6104da50 (patch) | |
tree | 63477c4878be44047f054092ab3a9b8bb77ba59f /modules/CIAO/connectors/dds4ccm/impl/ndds/InstanceHandleSeq.h | |
parent | 767b53703f187eddaf51b3a1d99c6984bf8ba75f (diff) | |
download | ATCD-3b37923a14c7db4d9d602cd9166be38f6104da50.tar.gz |
branching/tagging
Diffstat (limited to 'modules/CIAO/connectors/dds4ccm/impl/ndds/InstanceHandleSeq.h')
-rw-r--r-- | modules/CIAO/connectors/dds4ccm/impl/ndds/InstanceHandleSeq.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/modules/CIAO/connectors/dds4ccm/impl/ndds/InstanceHandleSeq.h b/modules/CIAO/connectors/dds4ccm/impl/ndds/InstanceHandleSeq.h new file mode 100644 index 00000000000..e3916285d14 --- /dev/null +++ b/modules/CIAO/connectors/dds4ccm/impl/ndds/InstanceHandleSeq.h @@ -0,0 +1,60 @@ +/** + * @author William R. Otte <wotte@dre.vanderbilt.edu> + * @author Johnny Willemsen <jwillemsen@remedy.nl> + * + * $Id$ + * + * Wrapper facade for NDDS. + */ + +#ifndef CIAO_RTI_INSTANCEHANDLESEQ_H +#define CIAO_RTI_INSTANCEHANDLESEQ_H + +#include "InstanceHandle_t.h" + +template <typename corbaseq, typename ddsseq> +void convert_dds_to_corba_sequence(corbaseq & target, const ddsseq& source) { + target.length (source.length ()); + for (::DDS_Long index = 0; index < source.length (); index++) + { + target[index] <<= source[index]; + } +} + +inline void +operator<<= (::DDS::InstanceHandleSeq &ddsinstancehandleseqseq, const ::DDS_InstanceHandleSeq & instancehandleseq) +{ + convert_dds_to_corba_sequence (ddsinstancehandleseqseq, instancehandleseq); +} + +inline void +operator<<= (::DDS_InstanceHandleSeq &ddsinstancehandleseqseq, const ::DDS::InstanceHandleSeq & instancehandleseq) +{ + ddsinstancehandleseqseq.length (instancehandleseq.length ()); + for (::DDS::InstanceHandleSeq::size_type index = 0; index < instancehandleseq.length (); index++) + { + ddsinstancehandleseqseq[index] <<= instancehandleseq[index]; + } +} + +inline void +operator>>= (const ::DDS_InstanceHandleSeq &instancehandle, ::DDS::InstanceHandleSeq & ddsinstancehandleseqseq) +{ + ddsinstancehandleseqseq.length (instancehandle.length ()); + for (::DDS_Long index = 0; index < instancehandle.length (); index++) + { + ddsinstancehandleseqseq[index] <<= instancehandle[index]; + } +} + +inline void +operator>>= (const ::DDS::InstanceHandleSeq &instancehandle, ::DDS_InstanceHandleSeq & ddsinstancehandleseqseq) +{ + ddsinstancehandleseqseq.length (instancehandle.length ()); + for (::DDS::InstanceHandleSeq::size_type index = 0; index < instancehandle.length (); index++) + { + ddsinstancehandleseqseq[index] <<= instancehandle[index]; + } +} + +#endif /* CIAO_RTI_INSTANCEHANDLESEQ_H */ |