21 #ifndef OTAWA_PROC_PROCESSOR_H
22 #define OTAWA_PROC_PROCESSOR_H
25 #include <elm/util/Cleaner.h>
26 #include <elm/util/Version.h>
27 #include <elm/system/StopWatch.h>
28 #include <elm/genstruct/Vector.h>
29 #include <elm/genstruct/HashTable.h>
30 #include <elm/util/Cleaner.h>
39 using namespace elm::genstruct;
40 class AbstractFeature;
43 class FeatureDependency;
55 virtual void clean(
void) { _ref.remove(); }
95 virtual void configure(
const PropList& props);
120 IS_TIMED = 0x01 << CUSTOM_SHIFT,
122 IS_ALLOCATED = 0x04 << CUSTOM_SHIFT,
123 IS_PREPARED = 0x08 << CUSTOM_SHIFT,
124 IS_COLLECTING = 0x10 << CUSTOM_SHIFT;
148 void warn(
const String& message);
155 { cleaners.add(
clean_t(&feature, cleaner)); }
164 virtual void processWorkSpace(
WorkSpace *ws);
167 virtual void collectStats(
WorkSpace *ws);
170 virtual void processFrameWork(
WorkSpace *fw);
204 virtual void processWorkSpace(
WorkSpace *fw);
225 virtual String message(
void);
232 #endif // OTAWA_PROC_PROCESSOR_H
This class is an interface to get progress information about execution of a processor.
Definition: Progress.h:33
bool isCollectingStats(void) const
Definition: Processor.h:137
static Identifier< bool > TIMED
If the value of the associated property is true (default to false), time statistics will also be coll...
Definition: Processor.h:100
void addDeletor(const AbstractFeature &feature, const Ref< T *, Identifier< T * > > &ref)
Definition: Processor.h:158
elm::String name(void) const
Definition: Processor.h:91
A simple processor that does nothing.
Definition: Processor.h:195
This class provided feature requirement for non-program processor classes.
Definition: FeatureRequirer.h:31
A processor whise execution cause an exception throw.
Definition: Processor.h:202
static const PropList EMPTY
This is an empty proplist for convenience.
Definition: PropList.h:66
Abstract class to represent the registered processors.
Definition: Registration.h:80
bool isTimed(void) const
Test if the timed mode is activated (recording of timings in the statistics).
Definition: Processor.h:133
virtual void clean(void)
Definition: Processor.h:65
Definition: Processor.h:62
const AbstractFeature & feature(void) const
Get the feature causing the exception.
Definition: Processor.h:224
static Identifier< bool > COLLECT_STATS
This property allows to activate collection of statistics for the work of the current processor...
Definition: Processor.h:103
bool isAllocated(void) const
Definition: Processor.h:135
This exception is thrown when an feature can not be computed.
Definition: Processor.h:216
clean_list_t cleaners
Definition: Processor.h:188
void track(const AbstractFeature &feature, const Ref< T *, Identifier< T * > > &ref)
Track the release of an allocated object assigned to an identifier relatively to the given feature...
Definition: Processor.h:174
void addRemover(const AbstractFeature &feature, const Ref< T, Identifier< T > > &ref)
Definition: Processor.h:156
WorkSpace * ws
Definition: Processor.h:185
const int provide
Definition: Registration.h:44
Definition: Processor.h:211
virtual void clean(void)
Definition: Processor.h:55
const AbstractRegistration & registration(void)
Definition: Registry.h:54
PropList * stats
Definition: Processor.h:128
static Identifier< elm::system::time_t > RUNTIME
This property identifier is used to store in the statistics of a processor the overall run time of th...
Definition: Processor.h:112
AbstractRegistration * _reg
Definition: Processor.h:184
Progress * _progress
Definition: Processor.h:189
static Identifier< elm::io::OutStream * > & OUTPUT
This property identifier is used for setting the output stream used by the processor to write results...
Definition: Processor.h:106
The processor class is implemented by all code processor.
Definition: Processor.h:49
Progress & progress(void)
Get the current progress handler.
Definition: Processor.h:150
A statistics collector allows to access statistics produced by an analysis.
Definition: StatCollector.h:30
const int use
Definition: Registration.h:46
A workspace represents a program, its run-time and all information about WCET computation or any othe...
Definition: WorkSpace.h:67
static Identifier< bool > & VERBOSE
This property activates the verbose mode of the processor: information about the processor work will ...
Definition: Processor.h:108
static Identifier< Progress * > PROGRESS
Install.
Definition: Processor.h:102
const int require
Definition: Registration.h:43
elm::Version version(void) const
Definition: Processor.h:92
static Identifier< PropList * > STATS
This property identifiers is used to pass a property list to the processor that will be used to store...
Definition: Processor.h:99
IntFormat f(signed char value)
Ref< T, Identifier< T > > _ref
Definition: Processor.h:58
const int invalidate
Definition: Registration.h:45
Deletor(const Ref< T *, Identifier< T * > > &ref)
Definition: Processor.h:64
WorkSpace * workspace(void) const
Get the current workspace.
Definition: Processor.h:149
T * track(const AbstractFeature &feature, T *object)
Definition: Processor.h:172
static Identifier< elm::io::OutStream * > & LOG
This property identifier is used for setting the log stream used by the processor to write messages (...
Definition: Processor.h:107
This class represents identifier with a typed associated value.
Definition: Identifier.h:51
cstring name
Definition: odisasm.cpp:107
static MetaRegistration reg
Definition: Processor.h:88
const Ref< T, Identifier< T > > & ref(void) const
Definition: Processor.h:57
elm::genstruct::SLList< clean_t > clean_list_t
Definition: Processor.h:187
bool recordsStats(void) const
Test if the statictics mode is activated.
Definition: Processor.h:134
See Feature.
Definition: AbstractFeature.h:36
This a list of properties.
Definition: PropList.h:63
static Identifier< bool > RECURSIVE
Definition: Processor.h:101
bool isPrepared(void) const
Definition: Processor.h:136
This class is used for returning exceptions from the processors.
Definition: ProcessorException.h:17
const AbstractFeature & f
Definition: Processor.h:227
Remover(const Ref< T, Identifier< T > > &ref)
Definition: Processor.h:54
void track(const AbstractFeature &feature, const Ref< T *, const Identifier< T * > > &ref)
Track the release of an allocated object assigned to an identifier relatively to the given feature...
Definition: Processor.h:176
static Identifier< log_level_t > & LOG_LEVEL
Property passed in the configuration property list of a processor to select the log level between LOG...
Definition: Processor.h:109
UnavailableFeatureException(const Processor *processor, const AbstractFeature &feature)
Definition: Processor.h:219
void addCleaner(const AbstractFeature &feature, Cleaner *cleaner)
Add a cleaner for the given feature.
Definition: Processor.h:154
Pair< const AbstractFeature *, Cleaner * > clean_t
Definition: Processor.h:186
Definition: Processor.h:52