DgnCore.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 
11 
12 
14 
15 //=======================================================================================
20 //=======================================================================================
21 struct HandlerId
22 {
23 private:
24  UInt32 m_id;
25 public:
26  enum {INVALID_ID=0};
27 
28  HandlerId() {m_id=INVALID_ID;}
29 
33  HandlerId (UInt16 major, UInt16 minor) {m_id = ((UInt32)major<<16)|minor;}
34 
36  UInt32 GetId () const {return m_id;}
38  UInt16 GetMajorId () const {return (UInt16) (m_id >> 16);}
40  UInt16 GetMinorId () const {return (UInt16) (0xffff & m_id);}
42  bool operator==(HandlerId const& other) const {return (m_id == other.m_id);}
44  bool operator!=(HandlerId const& other) const {return (m_id != other.m_id);}
46  bool operator< (HandlerId const& other) const {return m_id < other.m_id;}
48  bool IsValid () const {return GetMajorId() != INVALID_ID;}
49 };
50 
51 //=======================================================================================
55 //=======================================================================================
56 struct ElementHandlerId : public HandlerId
57 {
60  ElementHandlerId () : HandlerId (INVALID_ID, 0) {}
61 
66  ElementHandlerId (UInt16 major, UInt16 minor) : HandlerId (major, minor) {}
67 };
68 
69 //=======================================================================================
73 //=======================================================================================
75 {
78  XAttributeHandlerId () : HandlerId (INVALID_ID, 0) {}
79 
84  XAttributeHandlerId (UInt16 major, UInt16 minor) : HandlerId (major, minor) {}
85 };
86 
87 //=======================================================================================
90 //=======================================================================================
92 {
97  DgnModelHandlerId (UInt16 major, UInt16 minor) : HandlerId (major, minor) {}
98 };
99 
100 
A two-part ID used by DgnModel Model Handlers.
Definition: DgnCore.h:91
bool operator==(HandlerId const &other) const
Test two HandlerIds for equality.
Definition: DgnCore.h:42
#define END_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:69
ElementHandlerId()
Zero-initialize an ElementHandlerId prior to reading its data from a persistent data source...
Definition: DgnCore.h:60
A two-part ID used by Element Handlers.
Definition: DgnCore.h:56
uint16_t UInt16
Definition: Bentley.r.h:118
UInt32 GetId() const
Gets the full 32-bit ID.
Definition: DgnCore.h:36
UInt16 GetMinorId() const
Gets the minor ID portion of the HandlerID.
Definition: DgnCore.h:40
uint32_t UInt32
Definition: Bentley.r.h:128
A two-part ID used by XAttribute Handlers.
Definition: DgnCore.h:74
bool operator<(const basic_string< _CharT, _Traits, _Allocator > &__lhs, const basic_string< _CharT, _Traits, _Allocator > &__rhs)
Definition: basic_string.h:1326
UInt16 GetMajorId() const
Gets the major ID portion of the HandlerId.
Definition: DgnCore.h:38
bool IsValid() const
Test if the HandlerId has a non-zero major Id portion.
Definition: DgnCore.h:48
#define CLRPUBLIC
Definition: DgnPlatform/ExportMacros.h:12
HandlerId()
Definition: DgnCore.h:28
bool operator!=(HandlerId const &other) const
Test two HandlerIds for inequality.
Definition: DgnCore.h:44
DgnModelHandlerId(UInt16 major, UInt16 minor)
Constructor for DgnModelHandlerId.
Definition: DgnCore.h:97
XAttributeHandlerId(UInt16 major, UInt16 minor)
Define an XAttributeHandlerId.
Definition: DgnCore.h:84
#define BEGIN_BENTLEY_DGNPLATFORM_NAMESPACE
Definition: DgnPlatformBaseType.r.h:68
ElementHandlerId(UInt16 major, UInt16 minor)
Define an ElementHandlerId.
Definition: DgnCore.h:66
HandlerId(UInt16 major, UInt16 minor)
Define a handler Id.
Definition: DgnCore.h:33
XAttributeHandlerId()
Zero-initialize an XAttributeHandlerId.
Definition: DgnCore.h:78
A two-part identifier, consisting of a major ID and a minor ID.
Definition: DgnCore.h:21

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.