LRDE Tiger Compiler  1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
task::DisjunctiveTask Class Reference

#include <disjunctive-task.hh>

Inheritance diagram for task::DisjunctiveTask:
Collaboration diagram for task::DisjunctiveTask:

Public Types

typedef
TaskRegister::tasks_list_type 
tasks_list_type
typedef std::list< std::string > deps_type

Public Member Functions

 DisjunctiveTask (const char *module_name, const char *desc, const char *name, std::string deps)
virtual bool check () const override
 Check that the preconditions are verified.
virtual void execute () const override
 Execute this task.
virtual deps_type resolve_dependencies (tasks_list_type &active_tasks) const override
void print_dependencies () const
 Display dependencies of this task .
Accessors.
const char * name_get () const
const char * module_name_get () const
 Access to 'module_name'.
int key_get () const
 Access to 'key'.
const char * desc_get () const
 Access to 'desc'.
const char * argname_get () const
 The argument name.
void argname_set (const char *)
void arg_set (const char *arg) const
 The argument.
const char * arg_get () const
const deps_typedependencies_get () const
 Access to tasks dependencies.

Static Public Member Functions

static std::string normalize (const std::string &task_name)
 Normalize the name of a task.

Protected Attributes

std::string name_
 Task name.
const char * module_name_
 Module name to which the task belongs.
int key_
 The integer key provided by the this task to the option parser.
const char * desc_
 A short description of this task (displayed in program usage).
const char * argname_
 The name of the argument to display in the –help message.
const char * arg_
 The actual argument value.
deps_type dependencies_
 Contains the name of the tasks on which this one depends.

Detailed Description

A Task that make sure that AT LEAST one of its dependencies is scheduled.

Member Typedef Documentation

typedef std::list<std::string> task::Task::deps_type
inherited

Constructor & Destructor Documentation

task::DisjunctiveTask::DisjunctiveTask ( const char *  module_name,
const char *  desc,
const char *  name,
std::string  deps 
)

Member Function Documentation

const char * task::Task::arg_get ( ) const
inlineinherited
void task::Task::arg_set ( const char *  arg) const
inlineinherited

The argument.

References task::Task::arg_.

Referenced by task::TaskRegister::enable_task().

const char * task::Task::argname_get ( ) const
inlineinherited

The argument name.

References task::Task::argname_.

void task::Task::argname_set ( const char *  argname)
inlineinherited
bool task::DisjunctiveTask::check ( ) const
overridevirtual

Check that the preconditions are verified.

Implements task::Task.

const Task::deps_type & task::Task::dependencies_get ( ) const
inlineinherited
const char * task::Task::desc_get ( ) const
inlineinherited

Access to 'desc'.

References task::Task::desc_.

void task::DisjunctiveTask::execute ( ) const
overridevirtual

Execute this task.

Implements task::Task.

int task::Task::key_get ( ) const
inlineinherited

Access to 'key'.

References task::Task::key_.

Referenced by task::TaskRegister::register_task().

const char * task::Task::module_name_get ( ) const
inlineinherited

Access to 'module_name'.

References task::Task::module_name_.

const char * task::Task::name_get ( ) const
inlineinherited
Access to 'name'.

'const char*' is preferred to 'std::string' because TaskRegister calls C functions, that expect 'const char*'. The use of 'std::string::c_str()' is so forbidden and a call to 'strdup(std::string::c_str())' would implies dummy memory leaks.

References task::Task::name_.

Referenced by task::TaskRegister::print_task_graph(), task::TaskRegister::register_task(), and task::TaskRegister::resolve_dependencies().

std::string task::Task::normalize ( const std::string &  task_name)
staticinherited

Normalize the name of a task.

Referenced by task::Task::Task().

void task::Task::print_dependencies ( ) const
inherited

Display dependencies of this task .

Display dependencies of this task.

References task::Task::dependencies_, and task::Task::name_.

Task::deps_type task::DisjunctiveTask::resolve_dependencies ( tasks_list_type active_tasks) const
overridevirtual

Reimplemented from task::Task.

References task::Task::dependencies_.

Member Data Documentation

const char* task::Task::arg_
mutableprotectedinherited

The actual argument value.

Referenced by task::Task::arg_get(), and task::Task::arg_set().

const char* task::Task::argname_
protectedinherited

The name of the argument to display in the –help message.

Referenced by task::Task::argname_get(), and task::Task::argname_set().

deps_type task::Task::dependencies_
protectedinherited
const char* task::Task::desc_
protectedinherited

A short description of this task (displayed in program usage).

Referenced by task::Task::desc_get().

int task::Task::key_
protectedinherited

The integer key provided by the this task to the option parser.

From 'argp ()': "If key has a value that is a printable ASCII character (i.e., isascii (key) is true), it also specifies a short option '-char' where char is the ASCII character with the code key"

Referenced by task::Task::key_get(), and task::Task::Task().

const char* task::Task::module_name_
protectedinherited

Module name to which the task belongs.

Referenced by task::Task::module_name_get().

std::string task::Task::name_
protectedinherited

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