Audacity 3.2.0
Public Types | Public Member Functions | Static Public Member Functions | List of all members
ReservedCommandFlag Class Reference

#include <CommandFlag.h>

Inheritance diagram for ReservedCommandFlag:
[legend]
Collaboration diagram for ReservedCommandFlag:
[legend]

Public Types

using Predicate = std::function< bool(const AudacityProject &) >
 
using Predicates = std::vector< Predicate >
 

Public Member Functions

 ReservedCommandFlag (const Predicate &predicate, const CommandFlagOptions &options={})
 

Static Public Member Functions

static const std::vector< CommandFlagOptions > & Options ()
 
static const PredicatesRegisteredPredicates ()
 

Detailed Description

Definition at line 87 of file CommandFlag.h.

Member Typedef Documentation

◆ Predicate

using ReservedCommandFlag::Predicate = std::function< bool( const AudacityProject& ) >

Definition at line 90 of file CommandFlag.h.

◆ Predicates

Definition at line 91 of file CommandFlag.h.

Constructor & Destructor Documentation

◆ ReservedCommandFlag()

ReservedCommandFlag::ReservedCommandFlag ( const Predicate predicate,
const CommandFlagOptions options = {} 
)

Definition at line 37 of file CommandFlag.cpp.

39{
40 static size_t sNextReservedFlag = 0;
41 // This will throw std::out_of_range if the constant NCommandFlags is too
42 // small
43 set( sNextReservedFlag++ );
44 sPredicates().emplace_back( predicate );
45 sOptions().emplace_back( options );
46}
#define set(f, v)
std::vector< CommandFlagOptions > & sOptions()
Definition: CommandFlag.cpp:20
ReservedCommandFlag::Predicates & sPredicates()
Definition: CommandFlag.cpp:14

References set, anonymous_namespace{CommandFlag.cpp}::sOptions(), and anonymous_namespace{CommandFlag.cpp}::sPredicates().

Here is the call graph for this function:

Member Function Documentation

◆ Options()

const std::vector< CommandFlagOptions > & ReservedCommandFlag::Options ( )
static

Definition at line 32 of file CommandFlag.cpp.

33{
34 return sOptions();
35}

References anonymous_namespace{CommandFlag.cpp}::sOptions().

Referenced by CommandManager::GetUpdateFlags(), and CommandManager::TellUserWhyDisallowed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisteredPredicates()

const ReservedCommandFlag::Predicates & ReservedCommandFlag::RegisteredPredicates ( )
static

Definition at line 27 of file CommandFlag.cpp.

28{
29 return sPredicates();
30}

References anonymous_namespace{CommandFlag.cpp}::sPredicates().

Referenced by CommandManager::GetUpdateFlags().

Here is the call graph for this function:
Here is the caller graph for this function:

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