ufe 7.0
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
ufeExcept.h
Go to the documentation of this file.
1#line 1 "D:/Jenkins/workspace/EMS/ECG/ufe/full/ufe-full-python3.13-windows/ufe/include/ufeExcept.h"
2#ifndef UFE_UFEEXCEPT_H
3#define UFE_UFEEXCEPT_H
4
5// ===========================================================================
6// Copyright 2025 Autodesk, Inc. All rights reserved.
7//
8// The use of this software is subject to the Autodesk Terms of Use or other
9// license agreement provided at the time of installation or download, or
10// which otherwise accompanies this software.
11// ===========================================================================
12
13#include "rtid.h"
14#include "path.h"
15#include "pathSegment.h"
16#include "value.h"
17
18#include <stdexcept>
19
21
23//
24// This class is fully inline, as its base class is in the Standard Library.
25// On Windows, exporting a class from a DLL requires exporting all its bases.
26// This post
27//
28// https://stackoverflow.com/questions/24511376/how-to-dllexport-a-class-derived-from-stdruntime-error
29//
30// suggests that different Standard Library exception class implementations
31// have different export linkage characteristics, so we avoid these differences
32// with a fully inline implementation, which is therefore not exported.
33//
34// This does cause clang to warn about the class having "no out-of-line virtual
35// method definitions; its vtable will be emitted in every translation unit
36// [-Werror,-Wweak-vtables]". As per
37//
38// http://llvm.org/docs/CodingStandards.html#provide-a-virtual-method-anchor-for-classes-in-headers
39//
40// this will cause the vtable and RTTI information to be emitted into every .o
41// (translation unit) that incluces this header, increasing .o size and link
42// time, so this header file should be included only as necessary.
43
44#ifdef __clang__
45#pragma clang diagnostic push
46#pragma clang diagnostic ignored "-Wweak-vtables"
47#endif
48
49class InvalidRunTimeName : public std::runtime_error
50{
51public:
53 std::runtime_error(rtName) {}
55 ~InvalidRunTimeName() override {}
56};
57
59//
60// See \ref Ufe::InvalidRunTimeName for inline implementation details.
61
62class InvalidRunTimeId : public std::out_of_range
63{
64public:
65 InvalidRunTimeId(const Rtid& rtId) :
66 std::out_of_range(std::to_string(rtId)) {}
68 ~InvalidRunTimeId() override {}
69};
70
72//
73// See \ref Ufe::InvalidRunTimeName for inline implementation details.
74
75class InvalidOperationOnPath : public std::out_of_range
76{
77public:
79 std::out_of_range(path.string()) {}
82};
83
85//
86// See \ref Ufe::InvalidRunTimeName for inline implementation details.
87
88class InvalidOperationOnPathSegment : public std::out_of_range
89{
90public:
92 std::out_of_range(pathSegment.string()) {}
95};
96
98//
99// See \ref Ufe::InvalidRunTimeName for inline implementation details.
100
101class InvalidValueGet : public std::invalid_argument
102{
103public:
104 InvalidValueGet(const Value& v) : std::invalid_argument(v.typeName()) {}
106 ~InvalidValueGet() override {}
107};
108
109#ifdef __clang__
110#pragma clang diagnostic pop
111#endif
112
113}
114
115#endif /* UFE_UFEEXCEPT_H */
Exception class to signal an invalid path.
Definition: ufeExcept.h:76
InvalidOperationOnPath(const Path &path)
Definition: ufeExcept.h:78
~InvalidOperationOnPath() override
Definition: ufeExcept.h:81
InvalidOperationOnPath(const InvalidOperationOnPath &)=default
Exception class to signal an invalid path.
Definition: ufeExcept.h:89
InvalidOperationOnPathSegment(const InvalidOperationOnPathSegment &)=default
InvalidOperationOnPathSegment(const PathSegment &pathSegment)
Definition: ufeExcept.h:91
Exception class to signal an invalid runtime ID.
Definition: ufeExcept.h:63
~InvalidRunTimeId() override
Definition: ufeExcept.h:68
InvalidRunTimeId(const Rtid &rtId)
Definition: ufeExcept.h:65
InvalidRunTimeId(const InvalidRunTimeId &)=default
Exception class to signal unknown runtime ID.
Definition: ufeExcept.h:50
InvalidRunTimeName(const std::string &rtName)
Definition: ufeExcept.h:52
~InvalidRunTimeName() override
Definition: ufeExcept.h:55
InvalidRunTimeName(const InvalidRunTimeName &)=default
Exception class to signal if the template type doesn't match the type of the actual value.
Definition: ufeExcept.h:102
~InvalidValueGet() override
Definition: ufeExcept.h:106
InvalidValueGet(const InvalidValueGet &)=default
InvalidValueGet(const Value &v)
Definition: ufeExcept.h:104
Identify an object or 3D path in the scene.
Definition: path.h:40
A segment of a path within a single runtime.
Definition: pathSegment.h:37
Value class that can hold a wide set of types.
Definition: value.h:66
std::string string(const Path &path)
Path path(const std::string &pathString)
uint32_t Rtid
Definition: rtid.h:27
Definition: path.h:202
#define UFE_NS_DEF
Definition: ufe.h:36