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