GTIRB
v2.2.0
GrammaTech Intermediate Representation for Binaries: C++ API
|
Node and its subclasses support custom casting machinery that allows for type checking, safer static casting, and safe dynamic casting without needing the overhead of a vtable or RTTI. More...
Files | |
file | Casting.hpp |
The various casting and type checking operations that apply to gtirb::Node subclasses. | |
Node and its subclasses support custom casting machinery that allows for type checking, safer static casting, and safe dynamic casting without needing the overhead of a vtable or RTTI.
File Casting.hpp defines the various operations that apply to Node subclasses.
Perform a type check.
Val | The object to check. Cannot be null. |
true
if Val
is an instance of the template parameter type, false
otherwise.Example usage:
(Deprecated) Available in the global namespace when GTIRB_WRAP_UTILS_IN_NAMESPACE is enabled.
Cast to the specified type; the argument cannot be null.
Val | the value to cast. Cannot be null; consider using cast_or_null<Ty> in that case. |
Val
to the specified type. This function asserts that the types match and will not return null on failure.Example usage:
(Deprecated) Available in the global namespace when GTIRB_WRAP_UTILS_IN_NAMESPACE is enabled.
Cast to the specified type; the argument can be null.
Val | the value to cast. Can be null. |
Val
to the specified type. This function asserts that the types match and will not return null on failure. If Val
is null, returns a null pointer cast to the given type.Example usage:
(Deprecated) Available in the global namespace when GTIRB_WRAP_UTILS_IN_NAMESPACE is enabled.
Dynamic cast to the specified type; the argument cannot be null.
Val | the value to cast. Cannot be null; consider using dyn_cast_or_null<Ty> in that case. |
Val
to the specified type, or null if the casting operation fails because the types do not match.Example usage:
(Deprecated) Available in the global namespace when GTIRB_WRAP_UTILS_IN_NAMESPACE is enabled.
Cast to the specified type; the argument can be null.
Val | the value to cast. Can be null. |
Val
to the specified type, or null if the casting operation fails because the types do not match. If Val
is null, returns a null pointer cast to the given type.Example usage:
(Deprecated) Available in the global namespace when GTIRB_WRAP_UTILS_IN_NAMESPACE is enabled.