Apollo  6.0
Open source self driving car software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
apollo::cyber::scheduler::Scheduler Class Referenceabstract

#include <scheduler.h>

Inheritance diagram for apollo::cyber::scheduler::Scheduler:
Inheritance graph
Collaboration diagram for apollo::cyber::scheduler::Scheduler:
Collaboration graph

Public Member Functions

virtual ~Scheduler ()
 
bool CreateTask (const RoutineFactory &factory, const std::string &name)
 
bool CreateTask (std::function< void()> &&func, const std::string &name, std::shared_ptr< DataVisitorBase > visitor=nullptr)
 
bool NotifyTask (uint64_t crid)
 
void Shutdown ()
 
uint32_t TaskPoolSize ()
 
virtual bool RemoveTask (const std::string &name)=0
 
void ProcessLevelResourceControl ()
 
void SetInnerThreadAttr (const std::string &name, std::thread *thr)
 
virtual bool DispatchTask (const std::shared_ptr< CRoutine > &)=0
 
virtual bool NotifyProcessor (uint64_t crid)=0
 
virtual bool RemoveCRoutine (uint64_t crid)=0
 
void CheckSchedStatus ()
 
void SetInnerThreadConfs (const std::unordered_map< std::string, InnerThread > &confs)
 

Static Public Member Functions

static SchedulerInstance ()
 

Protected Member Functions

 Scheduler ()
 

Protected Attributes

AtomicRWLock id_cr_lock_
 
AtomicHashMap< uint64_t, MutexWrapper * > id_map_mutex_
 
std::mutex cr_wl_mtx_
 
std::unordered_map< uint64_t, std::shared_ptr< CRoutine > > id_cr_
 
std::vector< std::shared_ptr< ProcessorContext > > pctxs_
 
std::vector< std::shared_ptr< Processor > > processors_
 
std::unordered_map< std::string, InnerThread > inner_thr_confs_
 
std::string process_level_cpuset_
 
uint32_t proc_num_ = 0
 
uint32_t task_pool_size_ = 0
 
std::atomic< bool > stop_
 

Constructor & Destructor Documentation

◆ ~Scheduler()

virtual apollo::cyber::scheduler::Scheduler::~Scheduler ( )
inlinevirtual

◆ Scheduler()

apollo::cyber::scheduler::Scheduler::Scheduler ( )
inlineprotected

Member Function Documentation

◆ CheckSchedStatus()

void apollo::cyber::scheduler::Scheduler::CheckSchedStatus ( )

◆ CreateTask() [1/2]

bool apollo::cyber::scheduler::Scheduler::CreateTask ( const RoutineFactory factory,
const std::string &  name 
)

◆ CreateTask() [2/2]

bool apollo::cyber::scheduler::Scheduler::CreateTask ( std::function< void()> &&  func,
const std::string &  name,
std::shared_ptr< DataVisitorBase visitor = nullptr 
)

◆ DispatchTask()

virtual bool apollo::cyber::scheduler::Scheduler::DispatchTask ( const std::shared_ptr< CRoutine > &  )
pure virtual

◆ Instance()

static Scheduler* apollo::cyber::scheduler::Scheduler::Instance ( )
static

◆ NotifyProcessor()

virtual bool apollo::cyber::scheduler::Scheduler::NotifyProcessor ( uint64_t  crid)
pure virtual

◆ NotifyTask()

bool apollo::cyber::scheduler::Scheduler::NotifyTask ( uint64_t  crid)

◆ ProcessLevelResourceControl()

void apollo::cyber::scheduler::Scheduler::ProcessLevelResourceControl ( )

◆ RemoveCRoutine()

virtual bool apollo::cyber::scheduler::Scheduler::RemoveCRoutine ( uint64_t  crid)
pure virtual

◆ RemoveTask()

virtual bool apollo::cyber::scheduler::Scheduler::RemoveTask ( const std::string &  name)
pure virtual

◆ SetInnerThreadAttr()

void apollo::cyber::scheduler::Scheduler::SetInnerThreadAttr ( const std::string &  name,
std::thread *  thr 
)

◆ SetInnerThreadConfs()

void apollo::cyber::scheduler::Scheduler::SetInnerThreadConfs ( const std::unordered_map< std::string, InnerThread > &  confs)
inline

◆ Shutdown()

void apollo::cyber::scheduler::Scheduler::Shutdown ( )

◆ TaskPoolSize()

uint32_t apollo::cyber::scheduler::Scheduler::TaskPoolSize ( )
inline

Member Data Documentation

◆ cr_wl_mtx_

std::mutex apollo::cyber::scheduler::Scheduler::cr_wl_mtx_
protected

◆ id_cr_

std::unordered_map<uint64_t, std::shared_ptr<CRoutine> > apollo::cyber::scheduler::Scheduler::id_cr_
protected

◆ id_cr_lock_

AtomicRWLock apollo::cyber::scheduler::Scheduler::id_cr_lock_
protected

◆ id_map_mutex_

AtomicHashMap<uint64_t, MutexWrapper*> apollo::cyber::scheduler::Scheduler::id_map_mutex_
protected

◆ inner_thr_confs_

std::unordered_map<std::string, InnerThread> apollo::cyber::scheduler::Scheduler::inner_thr_confs_
protected

◆ pctxs_

std::vector<std::shared_ptr<ProcessorContext> > apollo::cyber::scheduler::Scheduler::pctxs_
protected

◆ proc_num_

uint32_t apollo::cyber::scheduler::Scheduler::proc_num_ = 0
protected

◆ process_level_cpuset_

std::string apollo::cyber::scheduler::Scheduler::process_level_cpuset_
protected

◆ processors_

std::vector<std::shared_ptr<Processor> > apollo::cyber::scheduler::Scheduler::processors_
protected

◆ stop_

std::atomic<bool> apollo::cyber::scheduler::Scheduler::stop_
protected

◆ task_pool_size_

uint32_t apollo::cyber::scheduler::Scheduler::task_pool_size_ = 0
protected

The documentation for this class was generated from the following file: