Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
INode.hpp File Reference
Include dependency graph for INode.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  shamrock::solvergraph::INode
 Inode is node between data edges, takes multiple inputs, multiple outputs. More...

Namespaces

namespace  shamrock
 namespace for the main framework

Macros

#define INODE_DECL_RO(type, name)
#define INODE_DECL_RW(type, name)
#define INODE_PARAM_RO(type, name)
#define INODE_PARAM_RW(type, name)
#define INODE_PUSH_RO1(type, name)
#define INODE_PUSH_RW1(type, name)
#define INODE_PUSH_RO2(type, name)
#define INODE_PUSH_RW2(type, name)
#define INODE_GET_RO(type, name)
#define INODE_GET_RW(type, name)
#define INODE_DECL_RO_OPTIONAL(type, name)
#define INODE_DECL_RW_OPTIONAL(type, name)
#define INODE_PARAM_RO_OPTIONAL(type, name)
#define INODE_PARAM_RW_OPTIONAL(type, name)
#define INODE_PUSH_RO1_OPTIONAL(type, name)
#define INODE_PUSH_RW1_OPTIONAL(type, name)
#define INODE_PUSH_RO2_OPTIONAL(type, name)
#define INODE_PUSH_RW2_OPTIONAL(type, name)
#define INODE_GET_RO_OPTIONAL(type, name)
#define INODE_GET_RW_OPTIONAL(type, name)
#define INODE_TEX_DECL(type, name)
#define INODE_TEX_GET_RO(type, name)
#define INODE_TEX_GET_RW(type, name)
#define INODE_TEX_REPLACE(type, name)
#define INODE_EXPAND_TEX_SYMBOLS(TEX_DECLS, TEX_GETS, TEX_REPLACES)
 Generate the TeX symbol helpers of a node from its edge list.
#define EXPAND_NODE_EDGES(EDGES)
#define EXPAND_NODE_EDGES_OPTIONAL(EDGES)

Detailed Description

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file INode.hpp.

Macro Definition Documentation

◆ EXPAND_NODE_EDGES

#define EXPAND_NODE_EDGES ( EDGES)
Value:
\
struct Edges { \
EDGES(INODE_DECL_RO, INODE_DECL_RW) \
}; \
\
inline void set_edges( \
EDGES(INODE_PARAM_RO, INODE_PARAM_RW) SourceLocation loc = SourceLocation{}) { \
__shamrock_log_callsite(loc); \
\
__internal_set_ro_edges({EDGES(INODE_PUSH_RO1, INODE_PUSH_RW1)}); \
__internal_set_rw_edges({EDGES(INODE_PUSH_RO2, INODE_PUSH_RW2)}); \
} \
\
inline Edges get_edges() { \
int ro = 0; \
int rw = 0; \
return Edges{EDGES(INODE_GET_RO, INODE_GET_RW)}; \
} \
\
INODE_EXPAND_TEX_SYMBOLS( \
EDGES(INODE_TEX_DECL, INODE_TEX_DECL), \
EDGES(INODE_TEX_GET_RO, INODE_TEX_GET_RW), \
EDGES(INODE_TEX_REPLACE, INODE_TEX_REPLACE))
provide information about the source location

Definition at line 364 of file INode.hpp.

◆ EXPAND_NODE_EDGES_OPTIONAL

#define EXPAND_NODE_EDGES_OPTIONAL ( EDGES)
Value:
\
struct Edges { \
EDGES(INODE_DECL_RO, INODE_DECL_RW, INODE_DECL_RO_OPTIONAL, INODE_DECL_RW_OPTIONAL) \
}; \
\
inline void set_edges( \
EDGES(INODE_PARAM_RO, INODE_PARAM_RW, INODE_PARAM_RO_OPTIONAL, INODE_PARAM_RW_OPTIONAL) \
__shamrock_log_callsite(loc); \
\
__internal_set_ro_edges({EDGES( \
INODE_PUSH_RO1, INODE_PUSH_RW1, INODE_PUSH_RO1_OPTIONAL, INODE_PUSH_RW1_OPTIONAL)}); \
__internal_set_rw_edges({EDGES( \
INODE_PUSH_RO2, INODE_PUSH_RW2, INODE_PUSH_RO2_OPTIONAL, INODE_PUSH_RW2_OPTIONAL)}); \
} \
\
inline Edges get_edges() { \
int ro = 0; \
int rw = 0; \
return Edges{ \
EDGES(INODE_GET_RO, INODE_GET_RW, INODE_GET_RO_OPTIONAL, INODE_GET_RW_OPTIONAL)}; \
} \
\
INODE_EXPAND_TEX_SYMBOLS( \
EDGES(INODE_TEX_DECL, INODE_TEX_DECL, INODE_TEX_DECL, INODE_TEX_DECL), \
EDGES(INODE_TEX_GET_RO, INODE_TEX_GET_RW, INODE_TEX_GET_RO, INODE_TEX_GET_RW), \
EDGES(INODE_TEX_REPLACE, INODE_TEX_REPLACE, INODE_TEX_REPLACE, INODE_TEX_REPLACE))

Definition at line 389 of file INode.hpp.

◆ INODE_DECL_RO

#define INODE_DECL_RO ( type,
name )
Value:
const type &name;

Definition at line 308 of file INode.hpp.

◆ INODE_DECL_RO_OPTIONAL

#define INODE_DECL_RO_OPTIONAL ( type,
name )
Value:
const std::optional<std::reference_wrapper<const type>> name;

Definition at line 319 of file INode.hpp.

◆ INODE_DECL_RW

#define INODE_DECL_RW ( type,
name )
Value:
type & name;

Definition at line 309 of file INode.hpp.

◆ INODE_DECL_RW_OPTIONAL

#define INODE_DECL_RW_OPTIONAL ( type,
name )
Value:
const std::optional<std::reference_wrapper<type>> name;

Definition at line 321 of file INode.hpp.

◆ INODE_EXPAND_TEX_SYMBOLS

#define INODE_EXPAND_TEX_SYMBOLS ( TEX_DECLS,
TEX_GETS,
TEX_REPLACES )
Value:
\
struct EdgesTexSymbols { \
TEX_DECLS \
}; \
\
inline EdgesTexSymbols get_edges_tex_symbols() const { \
int ro = 0; \
int rw = 0; \
return EdgesTexSymbols{TEX_GETS}; \
} \
\
inline void replace_edges_tex_symbols(std::string &tex) const { \
auto symbols = get_edges_tex_symbols(); \
TEX_REPLACES \
}

Generate the TeX symbol helpers of a node from its edge list.

Defines EdgesTexSymbols (one std::string per edge, named after it), get_edges_tex_symbols() and replace_edges_tex_symbols(tex) which replaces every {<edge name>} placeholder in tex by the TeX symbol of that edge. This lets _impl_get_tex refer to edges by name instead of by slot index, so that NODE_EDGES remains the single source of truth for the edge order.

Definition at line 347 of file INode.hpp.

◆ INODE_GET_RO

#define INODE_GET_RO ( type,
name )
Value:
get_ro_edge<type>(ro++),

Definition at line 316 of file INode.hpp.

◆ INODE_GET_RO_OPTIONAL

#define INODE_GET_RO_OPTIONAL ( type,
name )
Value:
get_ro_edge_optional<type>(ro++),

Definition at line 328 of file INode.hpp.

◆ INODE_GET_RW

#define INODE_GET_RW ( type,
name )
Value:
get_rw_edge<type>(rw++),

Definition at line 317 of file INode.hpp.

◆ INODE_GET_RW_OPTIONAL

#define INODE_GET_RW_OPTIONAL ( type,
name )
Value:
get_rw_edge_optional<type>(rw++),

Definition at line 329 of file INode.hpp.

◆ INODE_PARAM_RO

#define INODE_PARAM_RO ( type,
name )
Value:
const std::shared_ptr<type> &name,

Definition at line 310 of file INode.hpp.

◆ INODE_PARAM_RO_OPTIONAL

#define INODE_PARAM_RO_OPTIONAL ( type,
name )
Value:
const std::optional<std::shared_ptr<type>> &name,

Definition at line 322 of file INode.hpp.

◆ INODE_PARAM_RW

#define INODE_PARAM_RW ( type,
name )
Value:
const std::shared_ptr<type> &name,

Definition at line 311 of file INode.hpp.

◆ INODE_PARAM_RW_OPTIONAL

#define INODE_PARAM_RW_OPTIONAL ( type,
name )
Value:
const std::optional<std::shared_ptr<type>> &name,

Definition at line 323 of file INode.hpp.

◆ INODE_PUSH_RO1

#define INODE_PUSH_RO1 ( type,
name )
Value:
name,

Definition at line 312 of file INode.hpp.

◆ INODE_PUSH_RO1_OPTIONAL

#define INODE_PUSH_RO1_OPTIONAL ( type,
name )
Value:
shamrock::solvergraph::obsfucate_null_opt_edge(name),

Definition at line 324 of file INode.hpp.

◆ INODE_PUSH_RO2

#define INODE_PUSH_RO2 ( type,
name )

Definition at line 314 of file INode.hpp.

◆ INODE_PUSH_RO2_OPTIONAL

#define INODE_PUSH_RO2_OPTIONAL ( type,
name )

Definition at line 326 of file INode.hpp.

◆ INODE_PUSH_RW1

#define INODE_PUSH_RW1 ( type,
name )

Definition at line 313 of file INode.hpp.

◆ INODE_PUSH_RW1_OPTIONAL

#define INODE_PUSH_RW1_OPTIONAL ( type,
name )

Definition at line 325 of file INode.hpp.

◆ INODE_PUSH_RW2

#define INODE_PUSH_RW2 ( type,
name )
Value:
name,

Definition at line 315 of file INode.hpp.

◆ INODE_PUSH_RW2_OPTIONAL

#define INODE_PUSH_RW2_OPTIONAL ( type,
name )
Value:
shamrock::solvergraph::obsfucate_null_opt_edge(name),

Definition at line 327 of file INode.hpp.

◆ INODE_TEX_DECL

#define INODE_TEX_DECL ( type,
name )
Value:
std::string name;

Definition at line 333 of file INode.hpp.

◆ INODE_TEX_GET_RO

#define INODE_TEX_GET_RO ( type,
name )
Value:
get_ro_edge_base(ro++).get_tex_symbol(),

Definition at line 334 of file INode.hpp.

◆ INODE_TEX_GET_RW

#define INODE_TEX_GET_RW ( type,
name )
Value:
get_rw_edge_base(rw++).get_tex_symbol(),

Definition at line 335 of file INode.hpp.

◆ INODE_TEX_REPLACE

#define INODE_TEX_REPLACE ( type,
name )
Value:
shambase::replace_all(tex, "{" #name "}", symbols.name);
void replace_all(std::string &inout, std::string_view what, std::string_view with)
replace all occurence of a search string with another
Definition string.hpp:106

Definition at line 336 of file INode.hpp.