Skip to content
Snippets Groups Projects
Commit aa24b734 authored by Savici, Andrei T.'s avatar Savici, Andrei T.
Browse files

Refs #13690. Clang format

parent 66a72ac1
No related merge requests found
Showing
with 222 additions and 171 deletions
......@@ -11,27 +11,27 @@ namespace {
#define EXPORT_ARRAYBOUNDEDVALIDATOR(type, prefix) \
class_<ArrayBoundedValidator<type>, bases<IValidator>, boost::noncopyable>( \
#prefix "ArrayBoundedValidator") \
.def(init<type, type>( \
(arg("self"),arg("lowerBound"), arg("upperBound")), \
.def(init<type, type>( \
(arg("self"), arg("lowerBound"), arg("upperBound")), \
"A validator to ensure each value is in the given range")) \
.def("hasLower", &ArrayBoundedValidator<type>::hasLower, arg("self"), \
.def("hasLower", &ArrayBoundedValidator<type>::hasLower, arg("self"), \
"Returns true if a lower bound has been set") \
.def("hasUpper", &ArrayBoundedValidator<type>::hasUpper, arg("self"), \
.def("hasUpper", &ArrayBoundedValidator<type>::hasUpper, arg("self"), \
"Returns true if an upper bound has been set") \
.def("lower", &ArrayBoundedValidator<type>::lower, arg("self"), \
.def("lower", &ArrayBoundedValidator<type>::lower, arg("self"), \
return_value_policy<copy_const_reference>(), \
"Returns the lower bound") \
.def("upper", &ArrayBoundedValidator<type>::upper, arg("self"), \
.def("upper", &ArrayBoundedValidator<type>::upper, arg("self"), \
return_value_policy<copy_const_reference>(), \
"Returns the upper bound") \
.def("setLower", &ArrayBoundedValidator<type>::setLower, (arg("self"),arg("lower")), \
"Sets the lower bound") \
.def("setUpper", &ArrayBoundedValidator<type>::setUpper, (arg("self"),arg("upper")), \
"Sets the upper bound") \
.def("clearLower", &ArrayBoundedValidator<type>::clearLower, arg("self"), \
"Clear any set lower bound") \
.def("clearUpper", &ArrayBoundedValidator<type>::clearUpper, arg("self"), \
"Clear any set upper bound");
.def("setLower", &ArrayBoundedValidator<type>::setLower, \
(arg("self"), arg("lower")), "Sets the lower bound") \
.def("setUpper", &ArrayBoundedValidator<type>::setUpper, \
(arg("self"), arg("upper")), "Sets the upper bound") \
.def("clearLower", &ArrayBoundedValidator<type>::clearLower, \
arg("self"), "Clear any set lower bound") \
.def("clearUpper", &ArrayBoundedValidator<type>::clearUpper, \
arg("self"), "Clear any set upper bound");
}
void export_ArrayBoundedValidator() {
......
......@@ -12,38 +12,42 @@ namespace {
#define EXPORT_LENGTHVALIDATOR(type, prefix) \
class_<ArrayLengthValidator<type>, bases<IValidator>, boost::noncopyable>( \
#prefix "ArrayLengthValidator") \
.def(init<int>((arg("self"),arg("length")), "Constructs a validator verifying that " \
"an array is of the exact length given")) \
.def(init<int, int>((arg("self"),arg("lenmin"), arg("lenmax")), \
.def(init<int>((arg("self"), arg("length")), \
"Constructs a validator verifying that " \
"an array is of the exact length given")) \
.def(init<int, int>((arg("self"), arg("lenmin"), arg("lenmax")), \
"Constructs a validator verifying that the length " \
"of an array is within the range given")) \
.def("hasLength", &ArrayLengthValidator<type>::hasLength, arg("self"), \
.def("hasLength", &ArrayLengthValidator<type>::hasLength, arg("self"), \
"Returns true if a single length has been set") \
.def("hasMinLength", &ArrayLengthValidator<type>::hasMinLength, arg("self"), \
"Returns true if a minimum length has been set") \
.def("hasMaxLength", &ArrayLengthValidator<type>::hasMaxLength, arg("self"), \
"Returns true if a maximum length has been set") \
.def("hasMinLength", &ArrayLengthValidator<type>::hasMinLength, \
arg("self"), "Returns true if a minimum length has been set") \
.def("hasMaxLength", &ArrayLengthValidator<type>::hasMaxLength, \
arg("self"), "Returns true if a maximum length has been set") \
.def("getLength", &ArrayLengthValidator<type>::getLength, \
return_value_policy<copy_const_reference>(), arg("self"), \
return_value_policy<copy_const_reference>(), arg("self"), \
"Returns the set fixed length") \
.def("getMinLength", &ArrayLengthValidator<type>::getMinLength, \
return_value_policy<copy_const_reference>(), arg("self"), \
return_value_policy<copy_const_reference>(), arg("self"), \
"Returns the set minimum length") \
.def("getMaxLength", &ArrayLengthValidator<type>::getMaxLength, \
return_value_policy<copy_const_reference>(), arg("self"), \
return_value_policy<copy_const_reference>(), arg("self"), \
"Returns the set maximum length") \
.def("setLength", &ArrayLengthValidator<type>::setLength, (arg("self"),arg("length")), \
.def("setLength", &ArrayLengthValidator<type>::setLength, \
(arg("self"), arg("length")), \
"Set the accepted length of an array") \
.def("clearLength", &ArrayLengthValidator<type>::clearLength, arg("self"), \
"Clears accepted length of an array") \
.def("setLengthMin", &ArrayLengthValidator<type>::setLengthMin, (arg("self"),arg("minimum length")), \
.def("clearLength", &ArrayLengthValidator<type>::clearLength, \
arg("self"), "Clears accepted length of an array") \
.def("setLengthMin", &ArrayLengthValidator<type>::setLengthMin, \
(arg("self"), arg("minimum length")), \
"Set the accepted minimum length of an array") \
.def("setLengthMax", &ArrayLengthValidator<type>::setLengthMax, (arg("self"),arg("maximum length")), \
.def("setLengthMax", &ArrayLengthValidator<type>::setLengthMax, \
(arg("self"), arg("maximum length")), \
"Set the accepted maximum length of an array") \
.def("clearLengthMin", &ArrayLengthValidator<type>::clearLengthMin, arg("self"), \
"Set the accepted minimum length of an array") \
.def("clearLengthMax", &ArrayLengthValidator<type>::clearLengthMax, arg("self"), \
"Set the accepted maximum length of an array");
.def("clearLengthMin", &ArrayLengthValidator<type>::clearLengthMin, \
arg("self"), "Set the accepted minimum length of an array") \
.def("clearLengthMax", &ArrayLengthValidator<type>::clearLengthMax, \
arg("self"), "Set the accepted maximum length of an array");
}
void export_ArrayLengthValidator() {
......
......@@ -30,17 +30,17 @@ typedef return_value_policy<Policies::VectorRefToNumpy<Converters::Clone>>
class_<ArrayProperty<type>, bases<PropertyWithValue<std::vector<type>>>, \
boost::noncopyable>(#prefix "ArrayProperty", no_init) \
.def(init<const std::string &, const unsigned int>( \
(arg("self"),arg("name"), arg("direction") = Direction::Input), \
(arg("self"), arg("name"), arg("direction") = Direction::Input), \
"Construct an ArrayProperty of type" #type)) \
\
.def(init<const std::string &, IValidator_sptr, const unsigned int>( \
(arg("self"),arg("name"), arg("validator"), \
(arg("self"), arg("name"), arg("validator"), \
arg("direction") = Direction::Input), \
"Construct an ArrayProperty of type" #type "with a validator")) \
\
.def(init<const std::string &, const std::string &, IValidator_sptr, \
const unsigned int>( \
(arg("self"),arg("name"), arg("values"), \
(arg("self"), arg("name"), arg("values"), \
arg("validator") = IValidator_sptr(new NullValidator), \
arg("direction") = Direction::Input), \
"Construct an ArrayProperty of type" #type \
......
......@@ -67,35 +67,38 @@ createExclusiveBoundedValidator(object lower = object(),
default_call_policies(), \
(arg("lower") = object(), arg("upper") = object(), \
arg("exclusive") = false))) \
.def("setLower", &BoundedValidator<ElementType>::setLower, (arg("self"),arg("lower")), \
"Set the lower bound") \
.def("setUpper", &BoundedValidator<ElementType>::setUpper, (arg("self"),arg("upper")), \
"Set the upper bound") \
.def("setLower", &BoundedValidator<ElementType>::setLower, \
(arg("self"), arg("lower")), "Set the lower bound") \
.def("setUpper", &BoundedValidator<ElementType>::setUpper, \
(arg("self"), arg("upper")), "Set the upper bound") \
.def("setLowerExclusive", \
&BoundedValidator<ElementType>::setLowerExclusive, (arg("self"),arg("exclusive")), \
&BoundedValidator<ElementType>::setLowerExclusive, \
(arg("self"), arg("exclusive")), \
"Sets if the lower bound is exclusive") \
.def("setUpperExclusive", \
&BoundedValidator<ElementType>::setUpperExclusive, (arg("self"),arg("exclusive")), \
&BoundedValidator<ElementType>::setUpperExclusive, \
(arg("self"), arg("exclusive")), \
"Sets if the upper bound is exclsuive") \
.def("setExclusive", &BoundedValidator<ElementType>::setExclusive, (arg("self"),arg("exclusive")), \
.def("setExclusive", &BoundedValidator<ElementType>::setExclusive, \
(arg("self"), arg("exclusive")), \
"Sets both bounds to be inclusive/exclusive") \
.def("lower", &BoundedValidator<ElementType>::lower, arg("self"), \
.def("lower", &BoundedValidator<ElementType>::lower, arg("self"), \
return_value_policy<copy_const_reference>(), \
"Returns the lower bound") \
.def("upper", &BoundedValidator<ElementType>::upper, arg("self"), \
.def("upper", &BoundedValidator<ElementType>::upper, arg("self"), \
return_value_policy<copy_const_reference>(), \
"Returns the upper bound") \
.def("setBounds", &BoundedValidator<ElementType>::setBounds, (arg("self"),arg("lower"),arg("upper")), \
"Set both bounds") \
.def("hasLower", &BoundedValidator<ElementType>::hasLower, arg("self"), \
.def("setBounds", &BoundedValidator<ElementType>::setBounds, \
(arg("self"), arg("lower"), arg("upper")), "Set both bounds") \
.def("hasLower", &BoundedValidator<ElementType>::hasLower, arg("self"), \
"Returns True if a lower bound has been set") \
.def("hasUpper", &BoundedValidator<ElementType>::hasUpper, arg("self"), \
.def("hasUpper", &BoundedValidator<ElementType>::hasUpper, arg("self"), \
"Returns True if an upper bound has been set") \
.def("isLowerExclusive", \
&BoundedValidator<ElementType>::isLowerExclusive, arg("self"), \
&BoundedValidator<ElementType>::isLowerExclusive, arg("self"), \
"Returns True if the lower bound is exclusive") \
.def("isUpperExclusive", \
&BoundedValidator<ElementType>::isUpperExclusive, arg("self"), \
&BoundedValidator<ElementType>::isUpperExclusive, arg("self"), \
"Returns True if the upper bound is exclusive");
}
......
......@@ -39,6 +39,6 @@ void export_CompositeValidator() {
(arg("validators"))))
.def("add", (void (CompositeValidator::*)(IValidator_sptr)) &
CompositeValidator::add,(arg("self"),arg("other")),
"Add another validator to the list");
CompositeValidator::add,
(arg("self"), arg("other")), "Add another validator to the list");
}
......@@ -41,101 +41,117 @@ void export_ConfigService() {
std_vector_exporter<FacilityInfo *>::wrap("std_vector_facilityinfo");
class_<ConfigServiceImpl, boost::noncopyable>("ConfigServiceImpl", no_init)
.def("reset", &ConfigServiceImpl::reset,arg("self"),
.def("reset", &ConfigServiceImpl::reset, arg("self"),
"Clears all user settings and removes the user properties file")
.def("getLocalFilename", &ConfigServiceImpl::getLocalFilename,arg("self"),
"Returns the path to the system wide properties file.")
.def("getLocalFilename", &ConfigServiceImpl::getLocalFilename,
arg("self"), "Returns the path to the system wide properties file.")
.def("getUserFilename", &ConfigServiceImpl::getUserFilename,arg("self"),
.def("getUserFilename", &ConfigServiceImpl::getUserFilename, arg("self"),
"Returns the path to the user properties file")
.def("getInstrumentDirectory", &ConfigServiceImpl::getInstrumentDirectory,arg("self"),
.def("getInstrumentDirectory", &ConfigServiceImpl::getInstrumentDirectory,
arg("self"),
"Returns the directory used for the instrument definitions")
.def("getInstrumentDirectories",
&ConfigServiceImpl::getInstrumentDirectories,arg("self"),
&ConfigServiceImpl::getInstrumentDirectories, arg("self"),
return_value_policy<reference_existing_object>(),
"Returns the list of directories searched for the instrument "
"definitions")
.def("getFacilityNames", &ConfigServiceImpl::getFacilityNames,arg("self"),
"Returns the default facility")
.def("getFacilityNames", &ConfigServiceImpl::getFacilityNames,
arg("self"), "Returns the default facility")
.def("getFacilities", &ConfigServiceImpl::getFacilities,arg("self"),
.def("getFacilities", &ConfigServiceImpl::getFacilities, arg("self"),
"Returns the default facility")
.def("getFacility", (const FacilityInfo &(ConfigServiceImpl::*)() const) &
ConfigServiceImpl::getFacility,arg("self"),
return_value_policy<reference_existing_object>(),
ConfigServiceImpl::getFacility,
arg("self"), return_value_policy<reference_existing_object>(),
"Returns the default facility")
.def("getFacility",
(const FacilityInfo &(ConfigServiceImpl::*)(const std::string &)
const) &
ConfigServiceImpl::getFacility,
(arg("self"),arg("facilityName")),
(arg("self"), arg("facilityName")),
return_value_policy<reference_existing_object>(),
"Returns the named facility. Raises an RuntimeError if it does not "
"exist")
.def("setFacility", &ConfigServiceImpl::setFacility,(arg("self"),arg("facilityName")),
.def("setFacility", &ConfigServiceImpl::setFacility,
(arg("self"), arg("facilityName")),
"Sets the current facility to the given name")
.def("updateFacilities", &ConfigServiceImpl::updateFacilities,(arg("self"),arg("fileName")),
.def("updateFacilities", &ConfigServiceImpl::updateFacilities,
(arg("self"), arg("fileName")),
"Loads facility information from a provided file")
.def("getInstrument", &ConfigServiceImpl::getInstrument,
getInstrument_Overload(
"Returns the named instrument. If name = \"\" then the "
"default.instrument is returned",
(arg("self"),arg("instrumentName") =
(arg("self"),
arg("instrumentName") =
""))[return_value_policy<copy_const_reference>()])
.def("getString", &ConfigServiceImpl::getString,
getString_Overload("Returns the named key's value. If use_cache = "
"true [default] then relative paths->absolute",
(arg("self"),arg("key"), arg("use_cache") = true)))
getString_Overload(
"Returns the named key's value. If use_cache = "
"true [default] then relative paths->absolute",
(arg("self"), arg("key"), arg("use_cache") = true)))
.def("setString", &ConfigServiceImpl::setString,(arg("self"),arg("key"),arg("value")),
.def("setString", &ConfigServiceImpl::setString,
(arg("self"), arg("key"), arg("value")),
"Set the given property name. "
"If it does not exist it is added to the current configuration")
.def("hasProperty", &ConfigServiceImpl::hasProperty,(arg("self"),arg("rootName")))
.def("hasProperty", &ConfigServiceImpl::hasProperty,
(arg("self"), arg("rootName")))
.def("getDataSearchDirs", &ConfigServiceImpl::getDataSearchDirs,arg("self"),
return_value_policy<copy_const_reference>(),
.def("getDataSearchDirs", &ConfigServiceImpl::getDataSearchDirs,
arg("self"), return_value_policy<copy_const_reference>(),
"Return the current list of data search paths")
.def("appendDataSearchDir", &ConfigServiceImpl::appendDataSearchDir,(arg("self"),arg("path")),
.def("appendDataSearchDir", &ConfigServiceImpl::appendDataSearchDir,
(arg("self"), arg("path")),
"Append a directory to the current list of data search paths")
.def("setDataSearchDirs",
(void (ConfigServiceImpl::*)(const std::string &)) &
ConfigServiceImpl::setDataSearchDirs,(arg("self"),arg("searchDirs")),
ConfigServiceImpl::setDataSearchDirs,
(arg("self"), arg("searchDirs")),
"Set the whole datasearch.directories property from a single "
"string. Entries should be separated by a ; character")
.def("setDataSearchDirs", &setDataSearchDirs,(arg("self"),arg("searchDirs")),
.def("setDataSearchDirs", &setDataSearchDirs,
(arg("self"), arg("searchDirs")),
"Set the datasearch.directories property from a list of strings.")
.def("saveConfig", &ConfigServiceImpl::saveConfig,(arg("self"),arg("filename")),
.def("saveConfig", &ConfigServiceImpl::saveConfig,
(arg("self"), arg("filename")),
"Saves the keys that have changed from their default to the given "
"filename")
.def("setFileLogLevel", &ConfigServiceImpl::setFileLogLevel,(arg("self"),arg("logLevel")),
"Sets the log level priority for the File log channel, logLevel 1 = Fatal, 6 = information, 7 = Debug")
.def("setConsoleLogLevel", &ConfigServiceImpl::setConsoleLogLevel,(arg("self"),arg("logLevel")),
"Sets the log level priority for the Console log channel, logLevel 1 = Fatal, 6 = information, 7 = Debug")
.def("setFileLogLevel", &ConfigServiceImpl::setFileLogLevel,
(arg("self"), arg("logLevel")), "Sets the log level priority for "
"the File log channel, logLevel 1 = "
"Fatal, 6 = information, 7 = Debug")
.def("setConsoleLogLevel", &ConfigServiceImpl::setConsoleLogLevel,
(arg("self"), arg("logLevel")),
"Sets the log level priority for the Console log channel, logLevel "
"1 = Fatal, 6 = information, 7 = Debug")
.def("keys", &ConfigServiceImpl::keys,arg("self"))
.def("keys", &ConfigServiceImpl::keys, arg("self"))
// Treat this as a dictionary
.def("__getitem__", &getStringUsingCache,(arg("self"),arg("key")))
.def("__setitem__", &ConfigServiceImpl::setString, (arg("self"),arg("key"),arg("value")))
.def("__contains__", &ConfigServiceImpl::hasProperty,(arg("self"),arg("key")))
.def("__getitem__", &getStringUsingCache, (arg("self"), arg("key")))
.def("__setitem__", &ConfigServiceImpl::setString,
(arg("self"), arg("key"), arg("value")))
.def("__contains__", &ConfigServiceImpl::hasProperty,
(arg("self"), arg("key")))
.def("Instance", &ConfigService::Instance,
return_value_policy<reference_existing_object>(),
"Returns a reference to the ConfigService")
......
......@@ -11,10 +11,11 @@ void export_DataItem() {
class_<DataItem, boost::noncopyable>("DataItem", no_init)
.def("id", &DataItem::id, arg("self"), "The string ID of the class")
.def("name", &DataItem::name, arg("self"),"The name of the object")
.def("threadSafe", &DataItem::threadSafe, arg("self"), "Returns true if the object "
"can be accessed safely from "
"multiple threads")
.def("name", &DataItem::name, arg("self"), "The name of the object")
.def("threadSafe", &DataItem::threadSafe, arg("self"),
"Returns true if the object "
"can be accessed safely from "
"multiple threads")
.def("__str__", &DataItem::name, arg("self"),
"Returns the string name of the object if it has been stored")
.def("__repr__", &DataItem::toString, arg("self"),
......
......@@ -20,17 +20,21 @@ std::string ISO8601StringPlusSpace(DateAndTime &self) {
void export_DateAndTime() {
class_<DateAndTime>("DateAndTime", no_init)
// Constructors
.def(init<const std::string>((arg("self"),arg("ISO8601 string")),"Construct from an ISO8601 string"))
.def(init<double, double>((arg("self"),arg("seconds"),arg("nanoseconds")),
.def(init<const std::string>((arg("self"), arg("ISO8601 string")),
"Construct from an ISO8601 string"))
.def(init<double, double>(
(arg("self"), arg("seconds"), arg("nanoseconds")),
"Construct using a number of seconds and nanoseconds (floats)"))
.def(init<int64_t, int64_t>((arg("self"),arg("seconds"),arg("nanoseconds")),
.def(init<int64_t, int64_t>(
(arg("self"), arg("seconds"), arg("nanoseconds")),
"Construct using a number of seconds and nanoseconds (integers)"))
.def(init<int64_t>((arg("self"),arg("total nanoseconds")),"Construct a total number of nanoseconds"))
.def("total_nanoseconds", &DateAndTime::totalNanoseconds,arg("self"))
.def("totalNanoseconds", &DateAndTime::totalNanoseconds,arg("self"))
.def("setToMinimum", &DateAndTime::setToMinimum,arg("self"))
.def("__str__", &ISO8601StringPlusSpace,arg("self"))
.def("__long__", &DateAndTime::totalNanoseconds,arg("self"))
.def(init<int64_t>((arg("self"), arg("total nanoseconds")),
"Construct a total number of nanoseconds"))
.def("total_nanoseconds", &DateAndTime::totalNanoseconds, arg("self"))
.def("totalNanoseconds", &DateAndTime::totalNanoseconds, arg("self"))
.def("setToMinimum", &DateAndTime::setToMinimum, arg("self"))
.def("__str__", &ISO8601StringPlusSpace, arg("self"))
.def("__long__", &DateAndTime::totalNanoseconds, arg("self"))
.def(self == self)
.def(self != self)
// cppcheck-suppress duplicateExpression
......@@ -44,22 +48,24 @@ void export_DateAndTime() {
void export_time_duration() {
class_<time_duration>("time_duration", no_init)
.def("hours", &time_duration::hours,arg("self"),
.def("hours", &time_duration::hours, arg("self"),
"Returns the normalized number of hours")
.def("minutes", &time_duration::minutes,arg("self"),
.def("minutes", &time_duration::minutes, arg("self"),
"Returns the normalized number of minutes +/-(0..59)")
.def("seconds", &time_duration::seconds,arg("self"),
.def("seconds", &time_duration::seconds, arg("self"),
"Returns the normalized number of seconds +/-(0..59)")
.def("total_seconds", &time_duration::total_seconds,arg("self"),
.def("total_seconds", &time_duration::total_seconds, arg("self"),
"Get the total number of seconds truncating any fractional seconds")
.def("total_milliseconds", &time_duration::total_milliseconds,arg("self"),
.def("total_milliseconds", &time_duration::total_milliseconds,
arg("self"),
"Get the total number of milliseconds truncating any remaining "
"digits")
.def("total_microseconds", &time_duration::total_microseconds,arg("self"),
.def("total_microseconds", &time_duration::total_microseconds,
arg("self"),
"Get the total number of microseconds truncating any remaining "
"digits")
.def(
"total_nanoseconds", &time_duration::total_nanoseconds,arg("self"),
"total_nanoseconds", &time_duration::total_nanoseconds, arg("self"),
"Get the total number of nanoseconds truncating any remaining digits")
;
......
......@@ -17,9 +17,9 @@ void export_DeltaEMode() {
.export_values();
class_<DeltaEMode, boost::noncopyable>("DeltaEMode", no_init)
.def("asString", &DeltaEMode::asString,arg("self"),
.def("asString", &DeltaEMode::asString, arg("self"),
"Returns the given type translated to a string")
.def("fromString", &DeltaEMode::fromString,arg("modeStr"),
.def("fromString", &DeltaEMode::fromString, arg("modeStr"),
"Returns the enumerated type translated from a string")
.def("availableTypes", &DeltaEMode::availableTypes,
return_value_policy<Policies::VectorToNumpy>(),
......
......@@ -18,12 +18,12 @@ void export_EnabledWhenProperty() {
"EnabledWhenProperty", no_init) // no default constructor
.def(init<std::string, ePropertyCriterion, std::string>(
(arg("self"),arg("otherPropName"), arg("when"), arg("value")),
(arg("self"), arg("otherPropName"), arg("when"), arg("value")),
"Enabled otherPropName property when value criterion meets that "
"given by the 'when' argument"))
.def(init<std::string, ePropertyCriterion>(
(arg("self"),arg("otherPropName"), arg("when")),
(arg("self"), arg("otherPropName"), arg("when")),
"Enabled otherPropName property when criterion does not require a "
"value, i.e isDefault"));
}
......@@ -13,56 +13,58 @@ void export_FacilityInfo() {
class_<FacilityInfo>("FacilityInfo", no_init)
.def("name", &FacilityInfo::name,arg("self"),
.def("name", &FacilityInfo::name, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns name of the facility as definined in the Facilities.xml "
"file")
.def("__str__", &FacilityInfo::name,arg("self"),
.def("__str__", &FacilityInfo::name, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns name of the facility as definined in the Facilities.xml "
"file")
.def("zeroPadding", &FacilityInfo::zeroPadding,arg("self"),
.def("zeroPadding", &FacilityInfo::zeroPadding, arg("self"),
"Returns default zero padding for this facility")
.def("delimiter", &FacilityInfo::delimiter,arg("self"),
.def("delimiter", &FacilityInfo::delimiter, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns the delimiter between the instrument name and the run "
"number.")
.def("extensions", &FacilityInfo::extensions,arg("self"),
.def("extensions", &FacilityInfo::extensions, arg("self"),
"Returns the list of file extensions that are considered as "
"instrument data files.")
.def("preferredExtension", &FacilityInfo::preferredExtension,arg("self"),
.def("preferredExtension", &FacilityInfo::preferredExtension, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns the extension that is preferred for this facility")
.def("archiveSearch", &FacilityInfo::archiveSearch,arg("self"),
.def("archiveSearch", &FacilityInfo::archiveSearch, arg("self"),
return_value_policy<copy_const_reference>(),
"Return the archive search interface names")
.def("instruments",
(const std::vector<InstrumentInfo> &(FacilityInfo::*)() const) &
FacilityInfo::instruments,arg("self"),
return_value_policy<copy_const_reference>(),
FacilityInfo::instruments,
arg("self"), return_value_policy<copy_const_reference>(),
"Returns a list of instruments of this facility as defined in the "
"Facilities.xml file")
.def("instruments", (std::vector<InstrumentInfo>(
FacilityInfo::*)(const std::string &) const) &
FacilityInfo::instruments,(arg("self"),arg("technique")),
FacilityInfo::instruments,
(arg("self"), arg("technique")),
"Returns a list of instruments of given technique")
.def("instrument", &FacilityInfo::instrument,(arg("self"),arg("instrumentName")),
.def("instrument", &FacilityInfo::instrument,
(arg("self"), arg("instrumentName")),
return_value_policy<copy_const_reference>(),
"Returns the instrument with the given name")
.def("liveListener", &FacilityInfo::liveListener,arg("self"),
.def("liveListener", &FacilityInfo::liveListener, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns the name of the default live listener")
.def("computeResources", &FacilityInfo::computeResources,arg("self"),
.def("computeResources", &FacilityInfo::computeResources, arg("self"),
"Returns a vector of the available compute resources");
}
......@@ -19,12 +19,11 @@ namespace {
class_<FilteredTimeSeriesProperty<TYPE>, bases<TimeSeriesProperty<TYPE>>, \
boost::noncopyable>(#Prefix "FilteredTimeSeriesProperty", no_init) \
.def(init<TimeSeriesProperty<TYPE> *, const TimeSeriesProperty<bool> &, \
const bool>("Constructor", (arg("self"), arg("source"), \
arg("filter"), \
arg("transferOwner")))) \
const bool>( \
"Constructor", \
(arg("self"), arg("source"), arg("filter"), arg("transferOwner")))) \
.def("unfiltered", &FilteredTimeSeriesProperty<TYPE>::unfiltered, \
(arg("self")), \
return_value_policy<RemoveConst>(), \
(arg("self")), return_value_policy<RemoveConst>(), \
"Returns a time series containing the unfiltered data");
}
......
......@@ -127,14 +127,16 @@ void export_IPropertyManager() {
return_value_policy<copy_const_reference>(),
"Returns the list of properties managed by this object")
.def("declareProperty", &declareProperty, (arg("self"), arg("name"),arg("value")),
.def("declareProperty", &declareProperty,
(arg("self"), arg("name"), arg("value")),
"Create a new named property")
.def("setPropertyValue", &IPropertyManager::setPropertyValue,
(arg("self"), arg("name"),arg("value")),
(arg("self"), arg("name"), arg("value")),
"Set the value of the named property via a string")
.def("setProperty", &setProperty, (arg("self"), arg("name"),arg("value")),
.def("setProperty", &setProperty,
(arg("self"), arg("name"), arg("value")),
"Set the value of the named property")
.def("setPropertySettings", &setPropertySettings,
......@@ -142,7 +144,8 @@ void export_IPropertyManager() {
"Assign the given IPropertySettings object to the named property")
.def("setPropertyGroup", &IPropertyManager::setPropertyGroup,
(arg("self"), arg("name"),arg("group")), "Set the group for a given property")
(arg("self"), arg("name"), arg("group")),
"Set the group for a given property")
.def("existsProperty", &IPropertyManager::existsProperty,
(arg("self"), arg("name")), "Returns whether a property exists")
......@@ -156,7 +159,8 @@ void export_IPropertyManager() {
(arg("self"), arg("name")), return_value_policy<return_by_value>(),
"Returns the property of the given name. Use .value to give the "
"value")
.def("__setitem__", &declareOrSetProperty, (arg("self"), arg("name"),arg("value")),
.def("__setitem__", &declareOrSetProperty,
(arg("self"), arg("name"), arg("value")),
"Set the value of the named property or create it if it doesn't "
"exist")
.def("__delitem__", &deleteProperty, (arg("self"), arg("name")),
......@@ -166,8 +170,8 @@ void export_IPropertyManager() {
(arg("self"), arg("name")), "Returns whether a property exists")
// Bonus methods to be even more like a dict
.def("has_key", &IPropertyManager::existsProperty, (arg("self"), arg("name")),
"Returns whether a property exists")
.def("has_key", &IPropertyManager::existsProperty,
(arg("self"), arg("name")), "Returns whether a property exists")
.def("keys", &getKeys, arg("self"))
.def("values", &IPropertyManager::getProperties, arg("self"),
return_value_policy<copy_const_reference>(),
......
......@@ -10,9 +10,11 @@ void export_IPropertySettings() {
register_ptr_to_python<IPropertySettings *>();
class_<IPropertySettings, boost::noncopyable>("IPropertySettings", no_init)
.def("isEnabled", &IPropertySettings::isEnabled,(arg("self"),arg("alg")),
.def("isEnabled", &IPropertySettings::isEnabled,
(arg("self"), arg("alg")),
"Is the property to be shown as enabled in the GUI. Default true.")
.def("isVisible", &IPropertySettings::isVisible,(arg("self"),arg("alg")),
.def("isVisible", &IPropertySettings::isVisible,
(arg("self"), arg("alg")),
"Is the property to be shown in the GUI? Default true.");
}
......@@ -12,38 +12,41 @@ void export_InstrumentInfo() {
std_vector_exporter<InstrumentInfo>::wrap("std_vector_InstrumentInfo");
class_<InstrumentInfo>("InstrumentInfo", no_init)
.def("name", &InstrumentInfo::name,arg("self"),
.def("name", &InstrumentInfo::name, arg("self"),
""
"Returns the full name of the instrument as defined in the "
"Facilites.xml file")
.def("shortName", &InstrumentInfo::shortName,arg("self"),
.def("shortName", &InstrumentInfo::shortName, arg("self"),
"Returns the abbreviated name of the instrument as definined in the "
"Facilites.xml file")
.def("__str__", &InstrumentInfo::shortName,arg("self"),
.def("__str__", &InstrumentInfo::shortName, arg("self"),
"Returns the abbreviated name of the instrument as definined in the "
"Facilites.xml file")
.def("zeroPadding", &InstrumentInfo::zeroPadding,(arg("self"),arg("runNumber")),
.def("zeroPadding", &InstrumentInfo::zeroPadding,
(arg("self"), arg("runNumber")),
"Returns zero padding for this instrument")
.def("filePrefix", &InstrumentInfo::filePrefix,(arg("self"),arg("runNumber")),
.def("filePrefix", &InstrumentInfo::filePrefix,
(arg("self"), arg("runNumber")),
"Returns file prefix for this instrument")
.def("delimiter", &InstrumentInfo::delimiter, arg("self"),"Returns the delimiter "
"between the instrument "
"name and the run number.")
.def("delimiter", &InstrumentInfo::delimiter, arg("self"),
"Returns the delimiter "
"between the instrument "
"name and the run number.")
.def("techniques", &InstrumentInfo::techniques,arg("self"),
.def("techniques", &InstrumentInfo::techniques, arg("self"),
return_value_policy<copy_const_reference>(),
"Return list of techniques this instrument supports")
.def("facility", &InstrumentInfo::facility,arg("self"),
.def("facility", &InstrumentInfo::facility, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns the facility that contains this instrument.")
.def("instdae", &InstrumentInfo::liveDataAddress,arg("self"),
.def("instdae", &InstrumentInfo::liveDataAddress, arg("self"),
return_value_policy<copy_const_reference>(),
"Returns the host name and the port of the machine hosting DAE and "
"providing port to connect to for a live data stream")
......
......@@ -34,7 +34,8 @@ createListValidator(const boost::python::list &allowedValues) {
.def("__init__", \
make_constructor(&createListValidator<type>, \
default_call_policies(), arg("allowedValues"))) \
.def("addAllowedValue", &ListValidator<type>::addAllowedValue, (arg("self"),arg("value")), \
.def("addAllowedValue", &ListValidator<type>::addAllowedValue, \
(arg("self"), arg("value")), \
"Adds a value to the list of accepted values");
}
......
......@@ -10,11 +10,13 @@ using namespace boost::python;
void export_LogFilter() {
class_<LogFilter, boost::noncopyable>(
"LogFilter", init<const Property *>((arg("self"),arg("property")),
"LogFilter", init<const Property *>(
(arg("self"), arg("property")),
"Creates a log filter using the log to be filtered"))
.def("data", &LogFilter::data, arg("self"),return_value_policy<return_by_value>(),
.def("data", &LogFilter::data, arg("self"),
return_value_policy<return_by_value>(),
"Returns a time series property filtered on current filter property")
.def("addFilter", &LogFilter::addFilter,(arg("self"),arg("filter")),
.def("addFilter", &LogFilter::addFilter, (arg("self"), arg("filter")),
"Adds a filter to the current list");
}
......@@ -25,28 +25,35 @@ void export_Logger() {
// To distinguish between the overloaded functions
typedef void (Logger::*LogLevelFunction)(const std::string &);
class_<Logger, boost::noncopyable>("Logger", init<std::string>((arg("self"),arg("name"))))
.def("fatal", (LogLevelFunction)&Logger::fatal,(arg("self"),arg("message")),
class_<Logger, boost::noncopyable>(
"Logger", init<std::string>((arg("self"), arg("name"))))
.def("fatal", (LogLevelFunction)&Logger::fatal,
(arg("self"), arg("message")),
"Send a message at fatal priority: "
"An unrecoverable error has occured and the application will "
"terminate")
.def("error", (LogLevelFunction)&Logger::error,(arg("self"),arg("message")),
.def("error", (LogLevelFunction)&Logger::error,
(arg("self"), arg("message")),
"Send a message at error priority: "
"An error has occured but the framework is able to handle it and "
"continue")
.def("warning", (LogLevelFunction)&Logger::warning,(arg("self"),arg("message")),
.def("warning", (LogLevelFunction)&Logger::warning,
(arg("self"), arg("message")),
"Send a message at warning priority: "
"Something was wrong but the framework was able to continue despite "
"the problem.")
.def("notice", (LogLevelFunction)&Logger::notice,(arg("self"),arg("message")),
.def("notice", (LogLevelFunction)&Logger::notice,
(arg("self"), arg("message")),
"Sends a message at notice priority: "
"Really important information that should be displayed to the user, "
"this should be minimal. The default logging level is set here "
"unless it is altered.")
.def("information", (LogLevelFunction)&Logger::information,(arg("self"),arg("message")),
.def("information", (LogLevelFunction)&Logger::information,
(arg("self"), arg("message")),
"Send a message at information priority: "
"Useful but not vital information to be relayed back to the user.")
.def("debug", (LogLevelFunction)&Logger::debug,(arg("self"),arg("message")),
.def("debug", (LogLevelFunction)&Logger::debug,
(arg("self"), arg("message")),
"Send a message at debug priority:"
". Anything that may be useful to understand what the code has been "
"doing for debugging purposes.")
......
......@@ -14,8 +14,8 @@ void export_Material() {
register_ptr_to_python<boost::shared_ptr<Material>>();
class_<Material, boost::noncopyable>("Material", no_init)
.def("name", &Material::name, arg("self"), return_value_policy<copy_const_reference>(),
"Name of the material")
.def("name", &Material::name, arg("self"),
return_value_policy<copy_const_reference>(), "Name of the material")
.add_property("numberDensity", make_function(&Material::numberDensity),
"Number density")
.add_property("temperature", make_function(&Material::temperature),
......@@ -23,18 +23,18 @@ void export_Material() {
.add_property("pressure", make_function(&Material::pressure), "Pressure")
.def("cohScatterXSection",
(double (Material::*)(double) const)(&Material::cohScatterXSection),
(arg("self"),arg("lambda") = (double)NeutronAtom::ReferenceLambda),
(arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda),
"Coherent Scattering Cross-Section")
.def("incohScatterXSection", (double (Material::*)(double)
const)(&Material::incohScatterXSection),
(arg("self"),arg("lambda") = (double)NeutronAtom::ReferenceLambda),
const)(&Material::incohScatterXSection),
(arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda),
"Incoherent Scattering Cross-Section")
.def("totalScatterXSection", (double (Material::*)(double)
const)(&Material::totalScatterXSection),
(arg("self"),arg("lambda") = (double)NeutronAtom::ReferenceLambda),
const)(&Material::totalScatterXSection),
(arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda),
"Total Scattering Cross-Section")
.def("absorbXSection",
(double (Material::*)(double) const)(&Material::absorbXSection),
(arg("self"),arg("lambda") = (double)NeutronAtom::ReferenceLambda),
(arg("self"), arg("lambda") = (double)NeutronAtom::ReferenceLambda),
"Absorption Cross-Section");
}
......@@ -6,7 +6,8 @@ using namespace boost::python;
void export_MemoryStats() {
class_<MemoryStats>("MemoryStats", init<>(arg("self"),"Construct MemoryStats object."))
class_<MemoryStats>("MemoryStats",
init<>(arg("self"), "Construct MemoryStats object."))
.def("update", &MemoryStats::update, arg("self"))
.def("totalMem", &MemoryStats::totalMem, arg("self"))
.def("availMem", &MemoryStats::availMem, arg("self"))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment