16#ifndef BIFROSTGRAPH_EXECUTOR_WATCHPOINT_LAYOUT_H
17#define BIFROSTGRAPH_EXECUTOR_WATCHPOINT_LAYOUT_H
19#include <BifrostGraph/Executor/internal/ExecutorExport.h>
36class WatchpointLayout;
37class WatchpointLayoutFactory;
38class WatchpointLayoutPath;
84 explicit inline operator bool() const noexcept {
return m_layout !=
nullptr; }
89 return m_layout == other.m_layout;
95 return m_layout != other.m_layout;
117 template <
typename T>
118 inline bool isA() const noexcept {
119 return dynamic_cast<T*
>(m_layout) !=
nullptr;
125 template <
typename T>
127 return *
static_cast<T*
>(m_layout);
190 std::size_t m_useCount = 0u;
206 bool placeHolder =
false);
215 bool placeHolder =
false);
336 Amino::Type
const& type,
367 Amino::Type
const& type,
406 void setWorkspace(
Workspace const& workspace)
noexcept;
410 friend class BifrostGraph::Executor::Private::WorkspaceImpl;
422 bool isValid() const noexcept;
466 bool getValue(
Amino::Any const& any,
468 Amino::String& out_value) const;
Type identifier for types.
BifrostGraph Executor Watchpoint.
bool exists(Amino::StringView path, Amino::String *errorMessage=nullptr)
Verify if a path exists.
Uninitialized
Tag for explicitly specifying that a constructor should not initialize any data members,...
Generic value class that allows for storage of a value of any type.
The string class used by Amino.
Type identifier for a type.
Structure that holds the sorting settings for getIndices.
A smart pointer on WatchpointLayout objects allowing them to be easily shared and managed.
bool operator==(WatchpointLayoutPtr const &other) const noexcept
Comparison.
WatchpointLayoutPtr & operator=(WatchpointLayoutPtr &&)
Assignment operators.
~WatchpointLayoutPtr()
Destructor If the pointer owns a layout object, its 'use count' is decremented by one....
WatchpointLayout const * operator->() const noexcept
Indirection.
bool isA() const noexcept
Check whether or not the pointed layout of type T.
WatchpointLayoutPtr()
Construct an empty pointer.
WatchpointLayoutPtr(WatchpointLayoutPtr const &other)
Copy constructor Construct a smart pointer on the same layout object as other and sharing ownership.
WatchpointLayout * get() const noexcept
Accessor.
T & getAs() const noexcept
Get the pointed layout casted as type T.
WatchpointLayoutPtr(WatchpointLayoutPtr &&other)
Move constructor Construct a smart pointer on the same layout object as other and taking ownership.
WatchpointLayout * operator->() noexcept
Indirection.
WatchpointLayoutPtr(WatchpointLayout *layout)
Construct a smart pointer that owns the layout object pointed by layout,.
bool operator!=(WatchpointLayoutPtr const &other) const noexcept
Comparison.
WatchpointLayoutPtr & operator=(WatchpointLayoutPtr const &)
Assignment operators.
virtual ~WatchpointLayout()
Destructor.
Amino::Type const & getType() const
Get the type the layout is based on.
static WatchpointLayoutPtr create(WatchpointLayoutFactory const &factory, Amino::TypeId const &typeId)
Create a new WatchpointLayout.
Amino::String const & getTypeName() const
Get the fully qualified type name the layout is based on.
WatchpointLayout(Amino::Type const &type, Amino::TypeId const &typeId)
Internal constructor.
static WatchpointLayoutPtr create(Amino::Type const &type, Amino::TypeId const &typeId)
Create a new WatchpointLayout.
virtual void deleteThis()
Function used by the smart pointer to destroy the instance.
Amino::String const & getTypeKind() const
Get the layout's kind name.
Amino::TypeId const & getTypeId() const
Get the typeId the layout is based on.
A composite layout, that contains sub layouts.
bool empty() const
Return whether or not the composite has no sub layouts.
bool hasFlattenedRepresentation() const
Check whether or not the composite has a flattened string representation.
~WatchpointLayoutComposite() override
Destructor.
static WatchpointLayoutPtr create(WatchpointLayoutFactory const &factory, Amino::TypeId const &typeId, bool placeHolder=false)
Create a new WatchpointLayoutComposite.
bool flattenedRepresentation(WatchpointLayoutFactory const &factory, Amino::Any const &value, Amino::String &out_value) const
Get the flattened string representation of the value based on the composite's custom layout.
static WatchpointLayoutPtr create(Amino::Type const &type, Amino::TypeId const &typeId, bool placeHolder=false)
Create a new WatchpointLayoutComposite.
WatchpointLayoutPtr const get(Amino::String const &name) const
Get the sub layout of given name.
Iterator begin() const
Return an iterator on the first sub layout.
WatchpointLayoutComposite(Amino::Type const &type, Amino::TypeId const &typeId, bool placeHolder)
Internal constructor.
bool placeHolder() const
Return whether or not this is a place holder for a custom layout.
Iterator end() const
Return an iterator past the last sub layout.
std::size_t size() const
Return the number of sub layouts.
Amino::String const & flattenedRepresentation() const
Get the template of the flattened string representation for the composite.
WatchpointLayoutPtr add(Amino::String const &name, WatchpointLayoutPtr const &layout)
Add a sub layout.
Forward iterator on the sub layouts.
SubLayout const & operator*() const
Get the layout pointed by current iterator.
bool operator!=(const Iterator &other) const
Comparison.
Iterator & operator++()
Advance to the next iterator.
bool operator==(const Iterator &other) const
Comparison.
Amino::String const & name() const
WatchpointLayoutPtr const & layout() const
Amino::String const & getElementTypeKind() const
Get the kind name of the element layout's.
WatchpointLayoutArray(WatchpointLayoutFactory const &factory, Amino::Type const &type, Amino::Any const &value)
Internal constructor.
bool getIndices(Watchpoint::Filters const &filters, Watchpoint::Sorter const &sorter, Watchpoint::Indices &out_indices) const
Helper to return the indices of the array for given filters and sorter settings.
std::size_t size() const
Return the number of elements.
Amino::Type const & getElementType() const
Get the element type of the layout array type.
Amino::TypeId const & getElementTypeId() const
Get the element typeId of the layout array type.
static WatchpointLayoutPtr create(WatchpointLayoutFactory const &factory, Amino::Type const &type, Amino::Any const &value)
Create a new WatchpointLayoutArray for value value.
Amino::String const & getElementTypeName() const
Get the fully qualified element type name of the layout array type.
~WatchpointLayoutArray() override
Destructor.
WatchpointLayoutPtr layout(std::size_t index) const
Get the layout of the element at given index.
static WatchpointLayoutPtr create(WatchpointLayoutFactory const &factory, Amino::Any const &value)
Create a new WatchpointLayoutArray for value value.
Layout factory to build layouts for types and/or values.
static WatchpointLayoutFactory & getInvalid() noexcept
Get a statically allocated factory that is uninitialized and invalid. Any operation on this instance ...
Path to an element in a layout.
WatchpointLayoutPath & operator=(WatchpointLayoutPath const &)
Assignment operators.
void push_back(Amino::String const &element)
Append an element.
WatchpointLayoutPath & pop_front()
Remove fist element.
bool frontIsIndex() const
Check if first item of path is an array index.
std::size_t frontAsIndex() const
Get the first element of the path as an array index.
void push_back(std::size_t index)
Append an array index.
Amino::String const & back() const
Get the last element of the path.
WatchpointLayoutPath & pop_back()
Remove last element.
WatchpointLayoutPath(WatchpointLayoutPath const &)
Constructors.
Amino::String const & front() const
Get the first element of the path.
void push_front(Amino::String const &element)
Prepend an element.
WatchpointLayoutPath & operator=(WatchpointLayoutPath &&)
Constructors.
~WatchpointLayoutPath()
/}
WatchpointLayoutPath(Amino::String const &path)
Constructors.
WatchpointLayoutPath()
Constructors.
std::size_t backAsIndex() const
Get the last element of the path as an array index.
WatchpointLayoutPath(WatchpointLayoutPath &&)
Constructors.
bool backIsIndex() const
Check if last item of path is an array index.
void push_front(std::size_t index)
Prepend an array index.
The Workspace is the central element of the BifrostGraph Executor.
BifrostGraph Executor common types.