• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

src/hpp/tdds/xtypes/TypeObject.hpp

Go to the documentation of this file.
00001 #ifndef OMG_TDDS_XTYPES_TYPE_OBJECT_HPP_
00002 #define OMG_TDDS_XTYPES_TYPE_OBJECT_HPP_
00003 
00004 /* Copyright 2010, Object Management Group, Inc.
00005  * Copyright 2010, PrismTech, Corp.
00006  * Copyright 2010, Real-Time Innovations, Inc.
00007  * All rights reserved.
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License");
00010  * you may not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  *     http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS,
00017  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #include <string>
00023 
00024 #include <dds/core/corefwd.hpp>
00025 #include <dds/core/Value.hpp>
00026 #include <tdds/xtypes/tdds_xtypes_fwd.hpp>
00027 
00028 
00029 #ifdef OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
00030 
00031 
00032 // --- Annotation usage: -------------------------------------------------
00033 
00038 template <typename DELEGATE>
00039 class tdds::type::typeobject::AnnotationMemberValue : public dds::core::Value<DELEGATE>
00040 {
00041     
00042 public:
00043     dds::type::TypeKind discriminator() const;
00044     void discriminator(dds::type::TypeKind d);
00045     
00046     bool as_bool() const;
00047     void as_bool(bool value);
00048     
00049     uint8_t as_byte() const;
00050     void as_byte(uint8_t value);
00051     
00052     int16_t as_int16() const;
00053     void as_int_16(int16_t value);
00054     
00055     uint16_t as_uint16() const;
00056     void as_uint_16(uint16_t value);
00057     
00058     int32_t as_int32() const;
00059     void as_int_32(int32_t value);
00060     
00061     uint32_t as_uint32() const;
00062     void as_uint32(uint32_t value);
00063     
00064     int32_t as_int64() const;
00065     void as_int64(int32_t value);
00066     
00067     uint64_t as_uint64() const;
00068     void as_uint64(uint64_t value);
00069     
00070     float as_float32() const;
00071     void as_float32(float value);
00072     
00073     double as_float64() const;
00074     void as_float64(double value);
00075     
00076     ldouble_t as_float128() const;
00077     void as_float128(ldouble_t value);
00078     
00079     char as_char() const;
00080     void as_char(char value);
00081     
00082     wchar_t as_wchar() const;
00083     void as_wchar(wchar_t value);
00084     
00085     int as_enum();
00086     void as_enum(int value);
00087     
00088     const std::string as_string();
00089     void as_string(const std::string& value);
00090     
00091     const std::wstring as_wstring();
00092     void as_wstring(const std::wstring& value);
00093 };
00094 
00095 
00099 template <typename DELEGATE>
00100 class tdds::type::typeobject::AnnotationUsageMember : public dds::core::Value<DELEGATE>
00101 {
00102     
00103 public:
00107     dds::type::MemberId member_id() const;
00108     void member_id(dds::type::MemberId id);
00109     
00113     const dds::type::typeobject::AnnotationMemberValue value() const;
00114     void value(const dds::type::typeobject::AnnotationMemberValue& value);
00115 };
00116 
00117 
00121 template <typename DELEGATE>
00122 class tdds::type::typeobject::AnnotationUsage : public dds::core::Value<DELEGATE>
00123 {
00124     
00125 public:
00126     dds::type::typeobject::TypeId type_id() const;
00127     void type_id(dds::type::typeobject::TypeId id);
00128     
00129     const dds::type::typeobject::AnnotationUsageMemberSeq member() const;
00130     dds::type::typeobject::AnnotationUsageMemberSeq& member(
00131         dds::type::typeobject::AnnotationUsageMemberSeq& dst);
00132     void member(const dds::type::typeobject::AnnotationUsageMemberSeq& src);
00133 };
00134 
00135 
00136 // --- Type base class: --------------------------------------------------
00137 
00141 template <typename DELEGATE>
00142 class tdds::type::typeobject::TypeProperty : public dds::core::Value<DELEGATE>
00143 {
00144     
00145 public:
00146     const dds::type::typeobject::TypeFlag::Mask flag() const;
00147     void flag(const dds::type::typeobject::TypeFlag::Mask& mask);
00148     
00149     dds::type::typeobject::TypeId type_id() const;
00150     void type_id(dds::type::typeobject::TypeId id);
00151     
00152     const std::string name();
00153     void name(const std::string& name);
00154 };
00155 
00156 
00160 template <typename DELEGATE>
00161 class tdds::type::typeobject::Type : public dds::core::Value<DELEGATE>
00162 {
00163 protected:
00164     Type(const DELEGATE& src);
00165 
00166 public:
00167     virtual ~Type();
00168     
00169 public:
00173     enum MemberId
00174     {
00175         PROPERTY_TYPE_MEMBER_ID   = 0,
00176         ANNOTATION_TYPE_MEMBER_ID = 1
00177     };
00178     
00179 public:
00180     const dds::type::typeobject::TypeProperty property() const;
00181     void property(const dds::type::typeobject::TypeProperty& value);
00182     
00183     const dds::type::typeobject::AnnotationUsageSeq annotation() const;
00184     dds::type::typeobject::AnnotationUsageSeq& annotation(
00185         dds::type::typeobject::AnnotationUsageSeq& dst);
00186     void annotation(const dds::type::typeobject::AnnotationUsageSeq& value);
00187 };
00188 
00189 
00190 // --- Aggregations: -----------------------------------------------------
00191 
00195 template <typename DELEGATE>
00196 class tdds::type::typeobject::MemberProperty : public dds::core::Value<DELEGATE>
00197 {
00198     
00199 public:
00200     const dds::type::typeobject::MemberFlag::Mask flag() const;
00201     void flag(const dds::type::typeobject::MemberFlag::Mask& value);
00202     
00203     dds::type::MemberId member_id() const;
00204     void member_id(dds::type::MemberId value);
00205     
00206     dds::type::typeobject::TypeId type_id() const;
00207     void type_id(dds::type::typeobject::TypeId value);
00208     
00209     const std::string name() const;
00210     void name(const std::string& value);
00211 };
00212 
00213 
00217 template <typename DELEGATE>
00218 class tdds::type::typeobject::Member : public dds::core::Value<DELEGATE>
00219 {
00220 protected:
00221     Member(const DELEGATE& src);
00222 
00223 public:
00224     virtual ~Member();
00225 
00226 public:
00230     enum MemberId {
00231         PROPERTY_MEMBER_MEMBER_ID   = 0,
00232         ANNOTATION_MEMBER_MEMBER_ID = 1
00233     };
00234     
00235 public:
00236     const dds::type::typeobject::MemberProperty property() const;
00237     void property(const dds::type::typeobject::MemberProperty& value);
00238     
00239     const dds::type::typeobject::AnnotationUsageSeq annotation();
00240     dds::type::typeobject::AnnotationUsageSeq& annotation(
00241         dds::type::typeobject::AnnotationUsageSeq& dst);
00242     void annotation(const dds::type::typeobject::AnnotationUsageSeq& value);
00243 };
00244 
00245 
00246 template <typename DELEGATE>
00247 class tdds::type::typeobject::StructureMember : public Member<DELEGATE>
00248 {
00249 };
00250 
00251 
00252 template <typename DELEGATE>
00253 class tdds::type::typeobject::StructureType : public Type<DELEGATE>
00254 {
00255 
00256 public:
00260     enum MemberId
00261     {
00262         BASE_TYPE_STRUCTURETYPE_MEMBER_ID = 100,
00263         MEMBER_STRUCTURETYPE_MEMBER_ID    = 101
00264     };
00265 
00266 public:
00267     dds::type::typeobject::TypeId base_type() const;
00268     void base_type(dds::type::typeobject::TypeId value);
00269 
00270     const dds::type::typeobject::StructureMemberSeq member() const;
00271     dds::type::typeobject::StructureMemberSeq& member(
00272         dds::type::typeobject::StructureMemberSeq& dst) const;
00273     void member(const dds::type::typeobject::StructureMemberSeq& value);
00274 };
00275 
00276 
00280 template <typename DELEGATE>
00281 class tdds::type::typeobject::UnionMember : public Member<DELEGATE>
00282 {
00283 
00284 public:
00288     enum MemberId
00289     {
00290         LABEL_UNIONMEMBER_MEMBER_ID = 100
00291     };
00292 
00293 public:
00294     const dds::type::UnionCaseLabelSeq label() const;
00295 
00296     dds::type::UnionCaseLabelSeq&
00297     label(dds::type::UnionCaseLabelSeq& dst) const;
00298 
00299     void label(const dds::type::UnionCaseLabelSeq& value);
00300 };
00301 
00302 
00303 template <typename DELEGATE>
00304 class tdds::type::typeobject::UnionType : public Type<DELEGATE>
00305 {
00306 
00307 public:
00311     enum MemberId
00312     {
00313         MEMBER_UNIONTYPE_MEMBER_ID = 100
00314     };
00315 
00316 public:
00317     const dds::type::typeobject::UnionMemberSeq member() const;
00318     dds::type::typeobject::UnionMemberSeq& member(
00319         dds::type::typeobject::UnionMemberSeq& dst) const;
00320     void member(const dds::type::typeobject::UnionMemberSeq& value);
00321 };
00322 
00323 
00327 template <typename DELEGATE>
00328 class tdds::type::typeobject::AnnotationMember : public Member<DELEGATE>
00329 {
00330 
00331 public:
00335     enum MemberId
00336     {
00337         DEFAULT_VALUE_ANNOTATIONMEMBER_MEMBER_ID = 100
00338     };
00339 
00340 public:
00341     const dds::type::typeobject::AnnotationMemberValue default_value() const;
00342     dds::type::typeobject::AnnotationMemberValue& default_value(
00343         dds::type::typeobject::AnnotationMemberValue& dst) const;
00344     void default_value(
00345         const dds::type::typeobject::AnnotationMemberValue& value);
00346 };
00347 
00348 
00349 template <typename DELEGATE>
00350 class tdds::type::typeobject::AnnotationType : public Type<DELEGATE>
00351 {
00352 
00353 public:
00357     enum MemberId
00358     {
00359         BASE_TYPE_ANNOTATIONTYPE_MEMBER_ID  = 100,
00360         MEMBER_ANNOTATIONTYPE_MEMBER_ID     = 101
00361     };
00362 
00363 public:
00364     dds::type::typeobject::TypeId base_type() const;
00365     void base_type(dds::type::typeobject::TypeId value);
00366 
00367     const dds::type::typeobject::AnnotationMemberSeq member() const;
00368     dds::type::typeobject::AnnotationMemberSeq& member(
00369         dds::type::typeobject::AnnotationMemberSeq& dst) const;
00370     void member(const dds::type::typeobject::AnnotationMemberSeq& value);
00371 };
00372 
00373 
00374 // --- Alias: ------------------------------------------------------------
00375 
00376 template <typename DELEGATE>
00377 class tdds::type::typeobject::AliasType : public Type<DELEGATE>
00378 {
00379 
00380 public:
00384     enum MemberId
00385     {
00386         BASE_TYPE_ALIASTYPE_MEMBER_ID = 100
00387     };
00388 
00389 public:
00390     dds::type::typeobject::TypeId base_type() const;
00391     void base_type(dds::type::typeobject::TypeId value);
00392 };
00393 
00394 
00395 // --- Collection type: ------------------------------------------------------
00396 
00400 template <typename DELEGATE>
00401 class tdds::type::typeobject::CollectionType : public Type<DELEGATE>
00402 {
00403 protected:
00404     CollectionType(const DELEGATE& src);
00405 
00406 public:
00407     virtual ~CollectionType();
00408 
00409 public:
00413     enum MemberId
00414     {
00415         ELEMENT_TYPE_COLLECTIONTYPE_MEMBER_ID = 100
00416     };
00417 
00418 public:
00419     dds::type::typeobject::TypeId element_type() const;
00420     void element_type(dds::type::typeobject::TypeId value);
00421 };
00422 
00423 
00424 template <typename DELEGATE>
00425 class tdds::type::typeobject::ArrayType : public CollectionType<DELEGATE>
00426 {
00427 
00428 public:
00432     enum MemberId
00433     {
00434         BOUND_ARRAYTYPE_MEMBER_ID = 200
00435     };
00436 
00437 public:
00438     const dds::type::BoundSeq bound() const;
00439     dds::type::BoundSeq& bound(
00440         dds::type::BoundSeq& dst) const;
00441     void bound(const dds::type::BoundSeq& value);
00442 };
00443 
00444 
00445 template <typename DELEGATE>
00446 class tdds::type::typeobject::MapType : public CollectionType<DELEGATE>
00447 {
00448 
00449 public:
00453     enum MemberId
00454     {
00455         KEY_ELEMENT_TYPE_MAPTYPE_MEMBER_ID  = 200,
00456         BOUND_MAPTYPE_MEMBER_ID             = 201
00457     };
00458 
00459 public:
00460     dds::type::typeobject::TypeId key_element_type() const;
00461     void key_element_type(dds::type::typeobject::TypeId value);
00462 
00463     dds::type::Bound bound() const;
00464     void bound(dds::type::Bound value);
00465 };
00466 
00467 
00468 template <typename DELEGATE>
00469 class tdds::type::typeobject::SequenceType : public CollectionType<DELEGATE>
00470 {
00471 
00472 public:
00476     enum MemberId
00477     {
00478         BOUND_SEQUENCETYPE_MEMBER_ID = 200
00479     };
00480 
00481 public:
00482     dds::type::Bound bound() const;
00483     void bound(dds::type::Bound value);
00484 };
00485 
00486 
00487 template <typename DELEGATE>
00488 class tdds::type::typeobject::StringType : public CollectionType<DELEGATE>
00489 {
00490 
00491 public:
00495     enum MemberId
00496     {
00497         BOUND_STRINGTYPE_MEMBER_ID = 200
00498     };
00499 
00500 public:
00501     dds::type::Bound bound() const;
00502     void bound(dds::type::Bound value);
00503 };
00504 
00505 
00506 // --- Bit set: --------------------------------------------------------------
00507 
00511 template <typename DELEGATE>
00512 class tdds::type::typeobject::Bit : public dds::core::Value<DELEGATE>
00513 {
00514 
00515 public:
00516     int32_t index() const;
00517     void index(int32_t value);
00518 
00519     const std::string name() const;
00520     void name(const std::string& value);
00521 };
00522 
00523 
00524 template <typename DELEGATE>
00525 class tdds::type::typeobject::BitSetType : public Type<DELEGATE>
00526 {
00527 
00528 public:
00532     enum MemberId
00533     {
00534         BIT_BOUND_BITSETTYPE_MEMBER_ID  = 100,
00535         BIT_BITSETTYPE_MEMBER_ID        = 101
00536     };
00537 
00538 public:
00539     dds::type::Bound bit_bound() const;
00540     void bit_bound(dds::type::Bound value);
00541 
00542     const dds::type::typeobject::BitSeq bit() const;
00543     dds::type::typeobject::BitSeq&
00544     bit(dds::type::typeobject::BitSeq& dst) const;
00545     void bit(const dds::type::typeobject::BitSeq& value);
00546 };
00547 
00548 
00549 // --- Enumeration: ----------------------------------------------------------
00550 
00554 template <typename DELEGATE>
00555 class tdds::type::typeobject::EnumeratedConstant : public dds::core::Value<DELEGATE>
00556 {
00557 
00558 public:
00559     int32_t value() const;
00560     void value(int32_t value);
00561 
00562     const std::string name() const;
00563     void name(const std::string& value);
00564 };
00565 
00566 
00570 template <typename DELEGATE>
00571 class tdds::type::typeobject::EnumerationType : public Type<DELEGATE>
00572 {
00573 
00574 public:
00578     enum MemberId
00579     {
00580         BIT_BOUND_ENUMERATIONTYPE_MEMBER_ID = 100,
00581         CONSTANT_ENUMERATIONTYPE_MEMBER_ID  = 101
00582     };
00583 
00584 public:
00585     dds::type::Bound bit_bound() const;
00586     void bit_bound(dds::type::Bound value);
00587 
00588     const dds::type::typeobject::EnumeratedConstantSeq constant() const;
00589     dds::type::typeobject::EnumeratedConstantSeq&
00590     constant(dds::type::typeobject::EnumeratedConstantSeq& dst) const;
00591     void constant(const dds::type::typeobject::EnumeratedConstantSeq& value);
00592 };
00593 
00594 
00595 // --- Module: -----------------------------------------------------------
00596 
00597 template <typename DELEGATE>
00598 class tdds::type::typeobject::Module : public dds::core::Value<DELEGATE>
00599 {
00600 
00601 public:
00602     const std::string name() const;
00603     void name(const std::string& value);
00604 
00605     const dds::type::typeobject::TypeLibrary& library() const;
00606     void library(const dds::type::typeobject::TypeLibrary& value);
00607 };
00608 
00609 
00610 // --- Type library: ---------------------------------------------------------
00611 
00615 template <typename DELEGATE>
00616 class tdds::type::typeobject::TypeLibraryElement : public dds::core::Value<DELEGATE>
00617 {
00618 
00619 public:
00623     enum Kind
00624     {
00625         ALIAS_TYPE_ELEMENT        = dds::type::ALIAS_TYPE,
00626         ANNOTATION_TYPE_ELEMENT   = dds::type::ANNOTATION_TYPE,
00627         ARRAY_TYPE_ELEMENT        = dds::type::ARRAY_TYPE,
00628         BITSET_TYPE_ELEMENT       = dds::type::BITSET_TYPE,
00629         ENUMERATION_TYPE_ELEMENT  = dds::type::ENUMERATION_TYPE,
00630         MAP_TYPE_ELEMENT          = dds::type::MAP_TYPE,
00631         SEQUENCE_TYPE_ELEMENT     = dds::type::SEQUENCE_TYPE,
00632         STRING_TYPE_ELEMENT       = dds::type::STRING_TYPE,
00633         STRUCTURE_TYPE_ELEMENT    = dds::type::STRUCTURE_TYPE,
00634         UNION_TYPE_ELEMENT        = dds::type::UNION_TYPE,
00635         
00636         MODULE_ELEMENT         // = auto-assigned value
00637     };
00638     
00639 public:
00640     Kind discriminator() const;
00641     void discriminator(Kind d);
00642 
00643     const dds::type::typeobject::AliasType& alias_type() const;
00644     void alias_type(const dds::type::typeobject::AliasType& value);
00645 
00646     const dds::type::typeobject::AnnotationType& annotation_type() const;
00647     void annotation_type(const dds::type::typeobject::AnnotationType& value);
00648 
00649     const dds::type::typeobject::ArrayType& array_type() const;
00650     void array_type(const dds::type::typeobject::ArrayType& value);
00651 
00652     const dds::type::typeobject::BitSetType& bitset_type() const;
00653     void bitset_type(const dds::type::typeobject::BitSetType& value);
00654 
00655     const dds::type::typeobject::EnumerationType& enumeration_type() const;
00656     void
00657     enumeration_type(const dds::type::typeobject::EnumerationType& value);
00658 
00659     const dds::type::typeobject::MapType& map_type() const;
00660     void map_type(const dds::type::typeobject::MapType& value);
00661 
00662     const dds::type::typeobject::SequenceType& sequence_type() const;
00663     void sequence_type(const dds::type::typeobject::SequenceType& value);
00664 
00665     const dds::type::typeobject::StringType& string_type() const;
00666     void string_type(const dds::type::typeobject::StringType& value);
00667 
00668     const dds::type::typeobject::StructureType& structure_type() const;
00669     void structure_type(const dds::type::typeobject::StructureType& value);
00670 
00671     const dds::type::typeobject::UnionType& union_type() const;
00672     void union_type(const dds::type::typeobject::UnionType& value);
00673 
00674     const dds::type::typeobject::Module& mod() const;
00675     void mod(const dds::type::typeobject::Module& value);
00676 };
00677 
00678 
00679 template <typename DELEGATE>
00680 class tdds::type::typeobject::TypeLibrary : public dds::core::Value<DELEGATE>
00681 {
00682     
00683 public:
00684     const dds::type::typeobject::TypeLibraryElementSeq element() const;
00685     dds::type::typeobject::TypeLibraryElementSeq&
00686     element(dds::type::typeobject::TypeLibraryElementSeq& dst) const;
00687     void element(const dds::type::typeobject::TypeLibraryElementSeq& value);
00688 };
00689 
00690 
00695 template <typename DELEGATE>
00696 class tdds::type::typeobject::TypeObject : public dds::core::Value<DELEGATE>
00697 {
00698 
00699 public:
00700     const dds::type::typeobject::TypeLibrary& library() const;
00701     void library(const dds::type::typeobject::TypeLibrary& value);
00702 
00703     dds::type::typeobject::TypeId the_type() const;
00704     void the_type(dds::type::typeobject::TypeId value);
00705 };
00706 
00707 
00708 #endif  // OMG_DDS_EXTENSIBLE_AND_DYNAMIC_TOPIC_TYPE_SUPPORT
00709 
00710 
00711 #endif // !defined(OMG_TDDS_XTYPES_TYPE_OBJECT_HPP_)

Generated on Tue Nov 9 2010 02:16:21 for dds-psm-cxx-doc by  doxygen 1.7.1