ifw-daq  3.0.0-pre2
IFW Data Acquisition modules
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
daq::dpm::Resource Class Reference

#include <scheduler.hpp>

Public Types

using Signal = boost::signals2::signal< void()>
 Signal that emits on changes to resources. More...
 

Public Member Functions

 Resource ()=default
 
 Resource (unsigned limit) noexcept
 
Resourceoperator= (Resource const &) noexcept=delete
 
std::optional< ResourceTokenAcquire () noexcept
 
void SetLimit (unsigned new_limit) noexcept
 
unsigned GetLimit () const noexcept
 
unsigned GetUsed () const noexcept
 
boost::signals2::connection Connect (Signal::slot_type const &slot)
 Connect to signal that is emitted when a resource become available. More...
 

Protected Member Functions

void Release () noexcept
 

Friends

class ResourceToken
 

Detailed Description

Definition at line 182 of file scheduler.hpp.

Member Typedef Documentation

◆ Signal

using daq::dpm::Resource::Signal = boost::signals2::signal<void()>

Signal that emits on changes to resources.

Definition at line 187 of file scheduler.hpp.

Constructor & Destructor Documentation

◆ Resource() [1/2]

daq::dpm::Resource::Resource ( )
default

◆ Resource() [2/2]

daq::dpm::Resource::Resource ( unsigned  limit)
inlineexplicitnoexcept

Definition at line 189 of file scheduler.hpp.

Member Function Documentation

◆ Acquire()

std::optional<ResourceToken> daq::dpm::Resource::Acquire ( )
inlinenoexcept

Definition at line 193 of file scheduler.hpp.

◆ Connect()

boost::signals2::connection daq::dpm::Resource::Connect ( Signal::slot_type const &  slot)
inline

Connect to signal that is emitted when a resource become available.

Definition at line 214 of file scheduler.hpp.

◆ GetLimit()

unsigned daq::dpm::Resource::GetLimit ( ) const
inlinenoexcept

Definition at line 204 of file scheduler.hpp.

◆ GetUsed()

unsigned daq::dpm::Resource::GetUsed ( ) const
inlinenoexcept

Definition at line 207 of file scheduler.hpp.

◆ operator=()

Resource& daq::dpm::Resource::operator= ( Resource const &  )
deletenoexcept

◆ Release()

void daq::dpm::Resource::Release ( )
protectednoexcept

Definition at line 50 of file scheduler.cpp.

◆ SetLimit()

void daq::dpm::Resource::SetLimit ( unsigned  new_limit)
inlinenoexcept

Definition at line 201 of file scheduler.hpp.

Friends And Related Function Documentation

◆ ResourceToken

friend class ResourceToken
friend

Definition at line 222 of file scheduler.hpp.


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