SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceWithOnDemandProperties.cpp
Go to the documentation of this file.
1
23#include "ElementsKernel/Logging.h"
24
28
30
31namespace SourceXtractor {
32
33static Elements::Logging logger = Elements::Logging::getLogger("SourceWithOnDemandProperties");
34
38
40 // if we have the property already, just return it
43 }
44
45 try {
46 // if not, get the task that makes it and execute, we should have it then
48 if (task) {
49 task->computeProperties(const_cast<SourceWithOnDemandProperties&>(*this));
51 }
52 }
53 catch (Elements::Exception& e) {
54 logger.debug() << e.what();
55 }
56
57 // no task available to make the property, just throw an exception
59}
60
65
66
67} // SEFramework namespace
68
void debug(const std::string &logMessage)
static Logging getLogger(const std::string &name="")
bool isPropertySet(const PropertyId &property_id) const
Returns true if the property is set.
const Property & getProperty(const PropertyId &property_id) const
Returns a reference to a Property if it is set, if not throws a PropertyNotFoundException.
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id)
Sets a property, overwriting it if necessary.
Identifier used to set and retrieve properties.
Definition PropertyId.h:40
An exception indicating that a Property was not available and could not be computed on demand.
Base class for all Properties. (has no actual content)
Definition Property.h:33
A Task that acts on a Source to compute one or more properties.
Definition SourceTask.h:36
std::shared_ptr< const TaskProvider > m_task_provider
SourceWithOnDemandProperties(const SourceWithOnDemandProperties &)=delete
const Property & getProperty(const PropertyId &property_id) const override
void setProperty(std::unique_ptr< Property > property, const PropertyId &property_id) override
T move(T... args)
static Elements::Logging logger