1 #ifndef COMPUTATIONDOMAIN_H
2 #define COMPUTATIONDOMAIN_H
12 #include "al/ui/al_Parameter.hpp"
15 class SynchronousDomain;
40 template <
class DomainType>
53 std::shared_ptr<DomainType>
newSubDomain(
bool prepend =
false);
77 void setTimeDelta(
double delta) { mTimeDrift = delta; }
104 std::vector<ParameterMeta *>
parameters() {
return mParameters; }
151 std::mutex mSubdomainLock;
153 double mTimeDrift{0.0};
154 std::vector<std::pair<std::shared_ptr<SynchronousDomain>,
bool>>
158 std::vector<ParameterMeta *> mParameters;
207 for (
auto callback : mStopCallbacks) {
217 template <
class DomainType>
221 auto newDomain = std::make_shared<DomainType>();
224 mSubDomainList.push_back({newDomain, prepend});
virtual bool start()=0
start the asyncrhonous execution of the domain
void callStartCallbacks()
callStartCallbacks should be called by children of this class after the domain has been set up to sta...
void callStopCallbacks()
callStopCallbacks should be called by children of this class on the stop request, before the domain h...
virtual bool stop()=0
stop the asyncrhonous execution of the domain
bool cleanupSubdomains(bool pre=false)
cleanup subdomains
std::vector< ParameterMeta * > parameters()
Return a list of parameters that control this domain.
bool initializeSubdomains(bool pre=false)
initializeSubdomains should be called within the domain's initialization function
void callCleanupCallbacks()
callInitializeCallbacks should be called by children of this class before the domain has been cleaned...
std::shared_ptr< DomainType > newSubDomain(bool prepend=false)
Add a synchronous domain to this domain.
void registerCleanupCallback(std::function< void(ComputationDomain *)> callback)
register callbacks to be called in the cleanup() function
virtual bool cleanup(ComputationDomain *parent=nullptr)
cleanup
void callInitializeCallbacks()
callInitializeCallbacks should be called by children of this class after the domain has been initiali...
void registerInitializeCallback(std::function< void(ComputationDomain *)> callback)
register callbacks to be called in the init() function
void removeSubDomain(std::shared_ptr< SynchronousDomain > subDomain)
Remove a subdomain.
bool tickSubdomains(bool pre=false)
execute subdomains
virtual bool init(ComputationDomain *parent=nullptr)
initialize
double timeDelta()
Return time delta with respect to previous processing pass for this domain.
virtual bool tick()
Execute a pass of the domain.