CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
BcfCommon.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2024, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2024 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef _BCF_COMMON_H
25#define _BCF_COMMON_H
26
27#include "OdPlatformSettings.h"
28#include "IfcBuildOptions.h"
29
30#include "RxObject.h"
31#include "SmartPtr.h"
32
33#include "BcfUnset.h"
34
38namespace OdBcf {
39
40#define MAX_ENTITY_COLLECTION_SIZE 1024
41#define FILE_BUFFER_SIZE 1024
42
43#define EXTENSIONS_FILE_NAME "extensions.xml"
44#define VERSION_FILE_NAME "bcf.version"
45#define DOCUMENT_FILE_NAME "documents.xml"
46#define PROJECT_FILE_NAME "project.bcfp"
47#define MARKUP_FILE_NAME "markup.bcf"
48#define DEFAULT_VIEWPOINT_FILE_NAME "viewpoint.bcfv"
49#define VIEWPOINT_FILE_EXTENSION "bcfv"
50#define DEFAULT_SNAPSHOT_FILE_NAME "snapshot.png"
51#define SNAPSHOT_FILE_EXTENSION "png"
52#define DOCUMENT_FOLDER_NAME "Documents"
53
54#define DECLARE_SET(MethodName, VariableType, VariableName) \
55 \
56void set##MethodName(const VariableType &VariableName##Value);
57
58#define DEFINE_SET(ClassName, MethodName, VariableType, VariableName) \
59 \
60void ClassName::set##MethodName(const VariableType &VariableName##Value) \
61{ \
62 VariableName = VariableName##Value; \
63}
64
65#define DECLARE_GET(MethodName, VariableType, VariableName) \
66 \
67VariableType& get##MethodName();
68
69#define DEFINE_GET(ClassName, MethodName, VariableType, VariableName) \
70 \
71VariableType& ClassName::get##MethodName() \
72{ \
73 return VariableName; \
74}
75
76#define DECLARE_CONST_ACCESSORS(MethodName, VariableType, VariableName) \
77 \
78const VariableType& get##MethodName() const; \
79 \
80bool is##MethodName##Unset() const;
81
82#define DEFINE_CONST_ACCESSORS(ClassName, MethodName, VariableType, VariableName) \
83 \
84const VariableType& ClassName::get##MethodName() const \
85{ \
86 return VariableName; \
87} \
88 \
89bool ClassName::is##MethodName##Unset() const \
90{ \
91 return OdBcf::Utils::isUnset(VariableName); \
92}
93
94#define DECLARE_ACCESSORS(MethodName, VariableType, VariableName) \
95 \
96DECLARE_SET( MethodName, VariableType, VariableName) \
97DECLARE_GET( MethodName, VariableType, VariableName) \
98DECLARE_CONST_ACCESSORS(MethodName, VariableType, VariableName)
99
100#define DEFINE_ACCESSORS(ClassName, MethodName, VariableType, VariableName) \
101 \
102DEFINE_SET( ClassName, MethodName, VariableType, VariableName) \
103DEFINE_GET( ClassName, MethodName, VariableType, VariableName) \
104DEFINE_CONST_ACCESSORS(ClassName, MethodName, VariableType, VariableName)
105
106#define INIT_RESULT(VariableName) \
107 \
108OdResult VariableName##Local; \
109if (VariableName == NULL) \
110{ \
111 VariableName = &VariableName##Local; \
112} \
113*VariableName = eOk;
114
115} //namespace OdBcf
116
117#endif // _BCF_COMMON_H