Antares Simulator
Power System Simulator
Antares::Dispatcher Namespace Reference

An ASynchroneous Job Dispatcher. More...

Functions

void Post (const Yuni::Job::IJob::Ptr &job)
 Post a new job in the thread pool. More...
 
bool Start ()
 Start the ASync Dispatcher.
 
void Stop (uint timeout=10000)
 Stop the ASync Dispatcher. More...
 
void Wait ()
 Wait for the end of all jobs.
 
bool Empty ()
 Get if some jobs are still running.
 
template<class C >
void Post (const C *object, void(C::*method)())
 Post a new event to run in the thread pool. More...
 
template<class C , class UserDataT >
void Post (const C *object, void(C::*method)(), const UserDataT &userdata)
 Post a new event to run in the thread pool. More...
 
void Post (const Yuni::Bind< void()> &job)
 Post a new event to run in the thread pool. More...
 
void StudyNew (bool force=false)
 Create a new study.
 
void StudyClose (bool force=false, bool closeMainFrm=false)
 Close the study.
 
void StudyOpen (const String &folder, bool force)
 
void StudyOpen (const Yuni::String &folder, bool force=false)
 Open a study.
 

Detailed Description

An ASynchroneous Job Dispatcher.

Function Documentation

◆ Post() [1/4]

template<class C >
void Antares::Dispatcher::Post ( const C *  object,
void(C::*)()  method 
)
inline

Post a new event to run in the thread pool.

Note: This method may run from any thread

◆ Post() [2/4]

template<class C , class UserDataT >
void Antares::Dispatcher::Post ( const C *  object,
void(C::*)()  method,
const UserDataT &  userdata 
)
inline

Post a new event to run in the thread pool.

Note: This method may run from any thread

◆ Post() [3/4]

void Antares::Dispatcher::Post ( const Yuni::Bind< void()> &  job)
inline

Post a new event to run in the thread pool.

Note: This method will be called from the any thread

◆ Post() [4/4]

void Antares::Dispatcher::Post ( const Yuni::Job::IJob::Ptr &  job)

Post a new job in the thread pool.

Note: This job may run from any thread

◆ Stop()

void Antares::Dispatcher::Stop ( uint  timeout = 10000)

Stop the ASync Dispatcher.

Parameters
timeoutThe timeout (in milliseconds) for waiting for the working jobs