RAMSES Documentation  27.0.130
Information for RAMSES users and developers
RamsesFrameworkTypes.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // Copyright (C) 2014 BMW Car IT GmbH
3 // -------------------------------------------------------------------------
4 // This Source Code Form is subject to the terms of the Mozilla Public
5 // License, v. 2.0. If a copy of the MPL was not distributed with this
6 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
7 // -------------------------------------------------------------------------
8 
9 #ifndef RAMSES_RAMSESFRAMEWORKTYPES_H
10 #define RAMSES_RAMSESFRAMEWORKTYPES_H
11 
13 #include "stdint.h"
14 #include <limits>
15 #include <string>
16 
17 namespace ramses
18 {
26  using status_t = uint32_t;
27 
32  constexpr const status_t StatusOK = 0u;
33 
37  struct SceneIdTag {};
38 
44 
49  using sceneVersionTag_t = uint64_t;
50 
54  constexpr const sceneVersionTag_t InvalidSceneVersionTag = static_cast<sceneVersionTag_t>(-1);
55 
58 
61 
64 
67 
73 
79 
83  struct resourceId_t
84  {
88  constexpr resourceId_t()
89  : lowPart(0)
90  , highPart(0)
91  {
92  }
93 
99  constexpr resourceId_t(uint64_t low, uint64_t high)
100  : lowPart(low)
101  , highPart(high)
102  {
103  }
104 
109  static constexpr resourceId_t Invalid()
110  {
111  return resourceId_t();
112  }
113 
118  constexpr bool isValid() const
119  {
120  return *this != Invalid();
121  }
122 
130  constexpr bool operator==(const resourceId_t& other) const
131  {
132  return highPart == other.highPart && lowPart == other.lowPart;
133  }
134 
142  constexpr bool operator!=(const resourceId_t& other) const
143  {
144  return !(*this == other);
145  }
146 
148  uint64_t lowPart;
150  uint64_t highPart;
151  };
152 
156  struct nodeIdTag {};
157 
162 
167  {
171  };
172 
176  enum class ELogLevel
177  {
178  Off,
179  Fatal,
180  Error,
181  Warn,
182  Info,
183  Debug,
184  Trace
185  };
186 
197  using LogHandlerFunc = std::function<void(ELogLevel, const std::string&, const std::string&)>;
198 
203 
208 
213 
215  struct pickableObjectTag {};
216 
219 
222 
224  struct sceneObjectTag {};
225 
228 
233 
239 
240 
245 
250 
256  {
258 
262 
264  };
265 }
266 
267 #endif
Helper class to create strongly typed values out of various types.
Definition: StronglyTypedValue.h:23
static constexpr StronglyTypedValue Invalid()
Static Getter for Invalid.
Definition: StronglyTypedValue.h:34
The RAMSES namespace contains all client side objects and functions used to implement RAMSES applicat...
Definition: AnimatedProperty.h:15
ELogLevel
Type of Ramses Log Level.
Definition: RamsesFrameworkTypes.h:177
std::function< void(ELogLevel, const std::string &, const std::string &)> LogHandlerFunc
Definition: RamsesFrameworkTypes.h:197
uint32_t status_t
Status is a handle to the result of an API call.
Definition: RamsesFrameworkTypes.h:26
EClearFlags
Clear flags used to specify which components of a render target or display buffer should be cleared.
Definition: RamsesFrameworkTypes.h:256
@ EClearFlags_All
Definition: RamsesFrameworkTypes.h:263
@ EClearFlags_Depth
Definition: RamsesFrameworkTypes.h:260
@ EClearFlags_None
Definition: RamsesFrameworkTypes.h:257
@ EClearFlags_Color
Definition: RamsesFrameworkTypes.h:259
@ EClearFlags_Stencil
Definition: RamsesFrameworkTypes.h:261
ERamsesShellType
Type of Ramses Shell.
Definition: RamsesFrameworkTypes.h:167
@ ERamsesShellType_Console
Definition: RamsesFrameworkTypes.h:169
@ ERamsesShellType_Default
Definition: RamsesFrameworkTypes.h:170
@ ERamsesShellType_None
Definition: RamsesFrameworkTypes.h:168
constexpr const status_t StatusOK
Status returned from RAMSES client API methods that succeeded.
Definition: RamsesFrameworkTypes.h:32
constexpr const resourceCacheFlag_t ResourceCacheFlag_DoNotCache
Requests the render to not cache a resource. This is the default value.
Definition: RamsesFrameworkTypes.h:212
uint64_t sceneVersionTag_t
Scene version tag used to refer to content versions of a scene. A scene version may be updated along ...
Definition: RamsesFrameworkTypes.h:49
constexpr const sceneVersionTag_t InvalidSceneVersionTag
Scene version tag used to refer to an invalid scene version.
Definition: RamsesFrameworkTypes.h:54
Struct used as unique id for the strongly typed scene id.
Definition: RamsesFrameworkTypes.h:37
Struct used as unique id for the strongly typed node Id.
Definition: RamsesFrameworkTypes.h:156
Dummy struct to uniquely define ramses::pickableObjectId_t.
Definition: RamsesFrameworkTypes.h:215
Struct used as unique id for the strongly-typed cache flag.
Definition: RamsesFrameworkTypes.h:202
Resource identifier used to refer to a resource.
Definition: RamsesFrameworkTypes.h:84
constexpr resourceId_t()
Default constructor initialized to Invalid.
Definition: RamsesFrameworkTypes.h:88
constexpr bool operator==(const resourceId_t &other) const
Equal compare operator.
Definition: RamsesFrameworkTypes.h:130
uint64_t highPart
High bits.
Definition: RamsesFrameworkTypes.h:150
constexpr bool operator!=(const resourceId_t &other) const
Unequal compare operator.
Definition: RamsesFrameworkTypes.h:142
constexpr resourceId_t(uint64_t low, uint64_t high)
Construct with low and high part.
Definition: RamsesFrameworkTypes.h:99
static constexpr resourceId_t Invalid()
Create invalid resource Id.
Definition: RamsesFrameworkTypes.h:109
uint64_t lowPart
Low bits.
Definition: RamsesFrameworkTypes.h:148
constexpr bool isValid() const
Check if resource is valid.
Definition: RamsesFrameworkTypes.h:118
Dummy struct to uniquely define ramses::sceneObjectId_t.
Definition: RamsesFrameworkTypes.h:224
Struct used as unique id for the strongly typed Wayland IVI Layer Id.
Definition: RamsesFrameworkTypes.h:244
Struct used as unique id for the strongly typed Wayland IVI Surface Id.
Definition: RamsesFrameworkTypes.h:232