struct
#include <src/vt/runnable/runnable.h>
RunnableNew Holds a runnable active handler along with all the context associated with it to run it independently of the where in the stack it was created.
Public types
-
template<typename... Args>using FnParamType = void(*)(Args...)
- using DispatcherType = auto_registry::BaseHandlersDispatcherPtr::pointer
- using DispatcherScatterType = auto_registry::BaseScatterDispatcherPtr::pointer
Public static functions
- static auto operator new(std::size_t sz) -> void*
- Operator new for runnables targeting pool.
- static void operator delete(void* ptr)
- Operator develop for runnables.
Constructors, destructors, conversion operators
-
template<typename U>RunnableNew(MsgSharedPtr<U> const& in_msg, ] bool in_is_threaded)
- Construct a new
RunnableNew
with a message. - RunnableNew(] bool in_is_threaded) explicit
- Construct a new
RunnableNew
without a message. - RunnableNew(RunnableNew&&) defaulted
- RunnableNew(RunnableNew const&) deleted
Public functions
- auto operator=(RunnableNew const&) -> RunnableNew& deleted
- auto operator=(RunnableNew&&) -> RunnableNew& defaulted
-
template<typename... Args>void addContextSetContext(Args && ... args)
- Add a new
SetContext
for this handler. -
template<typename... Args>void addContextTD(Args && ... args)
- Add a new
TD
for this handler. -
template<typename... Args>void addContextCont(Args && ... args)
- Add a new
Cont
for this handler. -
template<typename... Args>void addContextCol(Args && ... args)
- Add a new
Col
for this handler. -
template<typename... Args>void addContextLB(Args && ... args)
- Add a new
LB
for this handler. -
void setupHandlerElement(vrt::
collection:: UntypedCollection* elm, HandlerType handler) - Set up a handler to run on an collection object.
- void setupHandlerObjGroup(std::byte* obj, HandlerType handler)
- Set up a handler to run on an object group.
-
void setupHandlerElement(vrt::
VirtualContext* elm, HandlerType handler) - Set up a handler to run on an non-collection object.
- void setupHandler(HandlerType handler)
- Set up a basic handler to run.
- void run()
- Run the task!
-
template<typename Callable, typename... Args>auto runLambda(Callable&& c, Args && ... args) -> decltype(auto)
- Run the task as a lambda!
-
void send(elm::
ElementIDStruct elm, MsgSizeType bytes) - Loop through all contexts add run the
send()
method associated with this runnable. -
template<typename T>auto get() -> T*
- Get a context object by the type
T
. - auto getMsg() const -> BaseMsgType*
- Get the message associated with the runnable.
Public variables
Function documentation
static void* vt:: runnable:: RunnableNew:: operator new(std::size_t sz)
Operator new for runnables targeting pool.
Parameters | |
---|---|
sz in | the allocation size |
Returns | the new allocation |
static void vt:: runnable:: RunnableNew:: operator delete(void* ptr)
Operator develop for runnables.
Parameters | |
---|---|
ptr in | the pointer |
template<typename U>
vt:: runnable:: RunnableNew:: RunnableNew(MsgSharedPtr<U> const& in_msg,
] bool in_is_threaded)
Construct a new RunnableNew
with a message.
Parameters | |
---|---|
in_msg in | the message to pass to the task |
in_is_threaded in | whether the handler can be run with a thread |
vt:: runnable:: RunnableNew:: RunnableNew(] bool in_is_threaded) explicit
Construct a new RunnableNew
without a message.
Parameters | |
---|---|
in_is_threaded in | whether the handler can be run with a thread |
template<typename... Args>
void vt:: runnable:: RunnableNew:: addContextSetContext(Args && ... args)
Add a new SetContext
for this handler.
Parameters | |
---|---|
args in | arguments to build the context, forwarded to constructor of T |
template<typename... Args>
void vt:: runnable:: RunnableNew:: addContextTD(Args && ... args)
Add a new TD
for this handler.
Parameters | |
---|---|
args in | arguments to build the context, forwarded to constructor of T |
template<typename... Args>
void vt:: runnable:: RunnableNew:: addContextCont(Args && ... args)
Add a new Cont
for this handler.
Parameters | |
---|---|
args in | arguments to build the context, forwarded to constructor of T |
template<typename... Args>
void vt:: runnable:: RunnableNew:: addContextCol(Args && ... args)
Add a new Col
for this handler.
Parameters | |
---|---|
args in | arguments to build the context, forwarded to constructor of T |
template<typename... Args>
void vt:: runnable:: RunnableNew:: addContextLB(Args && ... args)
Add a new LB
for this handler.
Parameters | |
---|---|
args in | arguments to build the context, forwarded to constructor of T |
void vt:: runnable:: RunnableNew:: setupHandlerElement(vrt:: collection:: UntypedCollection* elm,
HandlerType handler)
Set up a handler to run on an collection object.
Parameters | |
---|---|
elm in | the object pointer |
handler in | the handler ID bits |
void vt:: runnable:: RunnableNew:: setupHandlerObjGroup(std::byte* obj,
HandlerType handler)
Set up a handler to run on an object group.
Parameters | |
---|---|
obj | |
handler in | the handler ID bits |
void vt:: runnable:: RunnableNew:: setupHandlerElement(vrt:: VirtualContext* elm,
HandlerType handler)
Set up a handler to run on an non-collection object.
Parameters | |
---|---|
elm in | the object pointer |
handler in | the handler ID bits |
void vt:: runnable:: RunnableNew:: setupHandler(HandlerType handler)
Set up a basic handler to run.
Parameters | |
---|---|
handler in | the handler ID bits |
void vt:: runnable:: RunnableNew:: run()
Run the task!
void vt:: runnable:: RunnableNew:: send(elm:: ElementIDStruct elm,
MsgSizeType bytes)
Loop through all contexts add run the send()
method associated with this runnable.
Parameters | |
---|---|
elm | |
bytes in | the message size |
template<typename T>
T* vt:: runnable:: RunnableNew:: get()
Get a context object by the type T
.
Returns | the pointer to the context object |
---|
BaseMsgType* vt:: runnable:: RunnableNew:: getMsg() const
Get the message associated with the runnable.
Returns | the message |
---|