This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
ofParameter.h
Go to the documentation of this file.
312const ofReadOnlyParameter<ParameterType, Friend> & ofParameterGroup::getReadOnly(const std::string& name) const{
317const ofReadOnlyParameter<ParameterType, Friend> & ofParameterGroup::getReadOnly(std::size_t pos) const{
322ofReadOnlyParameter<ParameterType, Friend> & ofParameterGroup::getReadOnly(const std::string& name){
456 typename std::enable_if<of::priv::has_saving_support<ParameterType>::value, std::string>::type toStringImpl(const ParameterType & value){
461 typename std::enable_if<!of::priv::has_saving_support<ParameterType>::value, std::string>::type toStringImpl(const ParameterType &){
466 typename std::enable_if<of::priv::has_loading_support<ParameterType>::value, ParameterType>::type fromStringImpl(const std::string & str){
471 typename std::enable_if<!of::priv::has_loading_support<ParameterType>::value, ParameterType>::type fromStringImpl(const std::string &){
498 ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max);
518 void addListener(ListenerClass * listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP){
523 void removeListener(ListenerClass * listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP){
573 ofParameter<ParameterType> & set(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max);
660,setMethod(std::bind(&ofParameter<ParameterType>::eventsSetValue, this, std::placeholders::_1)){}
665,setMethod(std::bind(&ofParameter<ParameterType>::eventsSetValue, this, std::placeholders::_1)) {}
670,setMethod(std::bind(&ofParameter<ParameterType>::eventsSetValue, this, std::placeholders::_1)) {}
675,setMethod(std::bind(&ofParameter<ParameterType>::eventsSetValue, this, std::placeholders::_1)){}
678ofParameter<ParameterType>::ofParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max)
680,setMethod(std::bind(&ofParameter<ParameterType>::eventsSetValue, this, std::placeholders::_1)){}
684inline ofParameter<ParameterType> & ofParameter<ParameterType>::operator=(const ofParameter<ParameterType> & v){
702ofParameter<ParameterType> & ofParameter<ParameterType>::set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max){
712ofParameter<ParameterType> & ofParameter<ParameterType>::set(const std::string& name, const ParameterType & value){
719inline ofParameter<ParameterType> & ofParameter<ParameterType>::setWithoutEventNotifications(const ParameterType & v){
873 setMethod = std::bind(&ofParameter<ParameterType>::eventsSetValue, this, std::placeholders::_1);
878 setMethod = std::bind(&ofParameter<ParameterType>::noEventsSetValue, this, std::placeholders::_1);
977inline ofParameter<ParameterType> & ofParameter<ParameterType>::operator<<=(const OtherType & v){
985inline ofParameter<ParameterType> & ofParameter<ParameterType>::operator>>=(const OtherType & v){
1031 void addListener(ListenerClass * listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP){
1036 void removeListener(ListenerClass * listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP){
1114 ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max);
1129 void addListener(ListenerClass * listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP);
1132 void removeListener(ListenerClass * listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP);
1153 ofReadOnlyParameter<ParameterType,Friend> & operator=(const ofReadOnlyParameter<ParameterType,Friend>& v);
1187 ofReadOnlyParameter<ParameterType,Friend>& set(const std::string& name, const ParameterType & value);
1188 ofReadOnlyParameter<ParameterType,Friend>& set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max);
1221//inline ofReadOnlyParameter<ParameterType,Friend>::ofReadOnlyParameter(ofParameter<ParameterType> & p)
1225//inline ofReadOnlyParameter<ParameterType,Friend>::ofReadOnlyParameter(ofReadOnlyParameter<ParameterType,Friend> & p)
1233inline ofReadOnlyParameter<ParameterType,Friend>::ofReadOnlyParameter(const std::string& name, const ParameterType & v)
1237inline ofReadOnlyParameter<ParameterType,Friend>::ofReadOnlyParameter(const std::string& name, const ParameterType & v, const ParameterType & min, const ParameterType & max)
1288inline void ofReadOnlyParameter<ParameterType,Friend>::addListener(ListenerClass * listener, ListenerMethod method, int prio){
1295inline void ofReadOnlyParameter<ParameterType,Friend>::removeListener(ListenerClass * listener, ListenerMethod method, int prio){
1302inline std::unique_ptr<of::priv::AbstractEventToken> ofReadOnlyParameter<ParameterType,Friend>::newListener(Args...args) {
1360inline const ParameterType & ofReadOnlyParameter<ParameterType,Friend>::operator=(const ParameterType & v){
1390inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator+=(const OtherType & v){
1397inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator-=(const OtherType & v){
1404inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator*=(const OtherType & v){
1411inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator/=(const OtherType & v){
1418inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator%=(const OtherType & v){
1425inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator&=(const OtherType & v){
1432inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator|=(const OtherType & v){
1439inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator^=(const OtherType & v){
1446inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator<<=(const OtherType & v){
1453inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::operator>>=(const OtherType & v){
1461inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::set(const ParameterType & v){
1467inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::set(const std::string& name, const ParameterType & value){
1473inline ofReadOnlyParameter<ParameterType,Friend> & ofReadOnlyParameter<ParameterType,Friend>::set(const std::string& name, const ParameterType & value, const ParameterType & min, const ParameterType & max){
1500std::shared_ptr<ofAbstractParameter> ofReadOnlyParameter<ParameterType,Friend>::newReference() const{
Base class for ofParameter, ofReadOnlyParameter and ofParameterGroup.
Definition ofParameter.h:24
virtual std::string valueType() const =0
virtual std::string toString() const =0
virtual const ofParameterGroup getFirstParent() const =0
virtual void setName(const std::string &name)=0
const ofReadOnlyParameter< ParameterType, Friend > & castReadOnly() const
Definition ofParameter.h:55
virtual void setParent(ofParameterGroup &_parent)=0
ofReadOnlyParameter< ParameterType, Friend > & castReadOnly()
Definition ofParameter.h:50
virtual std::string escape(const std::string &str) const
Definition ofParameter.cpp:11
virtual std::string getEscapedName() const
Definition ofParameter.cpp:6
virtual std::shared_ptr< ofAbstractParameter > newReference() const =0
virtual void setSerializable(bool serializable)=0
virtual std::string getName() const =0
const ofParameter< ParameterType > & cast() const
Definition ofParameter.h:45
virtual bool isReferenceTo(const ofAbstractParameter &other) const
Definition ofParameter.cpp:48
virtual const void * getInternalObject() const =0
friend std::istream & operator>>(std::istream &is, ofAbstractParameter &p)
Definition ofParameter.cpp:57
virtual bool isSerializable() const =0
virtual bool isReadOnly() const =0
friend std::ostream & operator<<(std::ostream &os, const ofAbstractParameter &p)
Definition ofParameter.cpp:52
virtual void fromString(const std::string &str)=0
std::vector< std::string > getGroupHierarchyNames() const
Definition ofParameter.cpp:38
Definition ofEvent.h:444
const ofParameterGroup getFirstParent() const
Definition ofParameter.h:1061
const void * getInternalObject() const
Definition ofParameter.h:1071
std::unique_ptr< of::priv::AbstractEventToken > newListener(Args...args)
Definition ofParameter.h:1041
void addListener(ListenerClass *listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofParameter.h:1031
ofParameter(const std::string &name)
void removeListener(ListenerClass *listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofParameter.h:1036
Definition ofParameter.h:84
void remove(std::size_t index)
ofParameter< ofDefaultVec2 > & getVec2f(const std::string &name)
ofParameter< ofDefaultVec4 > & getVec4f(const std::string &name)
const ofParameter< ofPoint > & getPoint(const std::string &name) const
std::vector< std::shared_ptr< ofAbstractParameter > >::iterator end()
Definition ofParameterGroup.cpp:504
const ofParameter< void > & getVoid(const std::string &name) const
const ofAbstractParameter & get(const std::string &name) const
const ofParameter< bool > & getBool(const std::string &name) const
ofParameter< bool > & getBool(const std::string &name)
void setParent(ofParameterGroup &parent)
Definition ofParameterGroup.cpp:492
ofParameterGroup & getGroup(const std::string &name)
std::shared_ptr< ofAbstractParameter > newReference() const
Definition ofParameterGroup.cpp:488
const ofParameter< float > & getFloat(const std::string &name) const
ofParameter< ofRectangle > & getRectangle(const std::string &name)
ofParameter< ofDefaultVec3 > & getVec3f(const std::string &name)
const ofParameter< ofDefaultVec4 > & getVec4f(const std::string &name) const
std::vector< std::shared_ptr< ofAbstractParameter > >::reverse_iterator rend()
Definition ofParameterGroup.cpp:520
ofEvent< ofAbstractParameter > & parameterChangedE()
Definition ofParameterGroup.cpp:452
friend std::ostream & operator<<(std::ostream &os, const ofParameterGroup &group)
ofParameter< float > & getFloat(const std::string &name)
void setSerializable(bool serializable)
Definition ofParameterGroup.cpp:472
bool getIsReadOnly(int position) const
const ofParameter< ofShortColor > & getShortColor(const std::string &name) const
ofAbstractParameter & operator[](const std::string &name)
ofParameter< int > & getInt(const std::string &name)
const ofParameter< std::string > & getString(const std::string &name) const
std::string getEscapedName() const
Definition ofParameterGroup.cpp:358
ofAbstractParameter & get(const std::string &name)
ofParameter< ofColor > & getColor(const std::string &name)
int getPosition(const std::string &name) const
Definition ofParameterGroup.cpp:344
ofParameter< ofFloatColor > & getFloatColor(const std::string &name)
const ofParameter< ofRectangle > & getRectangle(const std::string &name) const
const ofParameterGroup & getGroup(const std::string &name) const
void add(ofAbstractParameter &p, Args &... parameters)
Definition ofParameter.h:102
void remove(const std::string &name)
ofParameter< char > & getChar(const std::string &name)
const ofParameter< ofDefaultVec2 > & getVec2f(const std::string &name) const
const ofParameter< char > & getChar(const std::string &name) const
bool contains(const std::string &name) const
Definition ofParameterGroup.cpp:430
const ofParameter< ofFloatColor > & getFloatColor(const std::string &name) const
void fromString(const std::string &name)
Definition ofParameterGroup.cpp:372
const ofAbstractParameter & operator[](const std::string &name) const
const ofParameter< ofDefaultVec3 > & getVec3f(const std::string &name) const
ofParameter< std::string > & getString(const std::string &name)
std::vector< std::shared_ptr< ofAbstractParameter > >::iterator begin()
Definition ofParameterGroup.cpp:500
const ofParameter< int > & getInt(const std::string &name) const
ofParameter< ofShortColor > & getShortColor(const std::string &name)
const void * getInternalObject() const
Definition ofParameterGroup.cpp:484
const ofParameter< ofColor > & getColor(const std::string &name) const
ofParameterGroup(const std::string &name, Args &... p)
Definition ofParameter.h:95
std::string getType(std::size_t position) const
Definition ofParameterGroup.cpp:338
ofParameter< ofPoint > & getPoint(const std::string &name)
const ofReadOnlyParameter< ParameterType, Friend > & getReadOnly(const std::string &name) const
Definition ofParameter.h:312
ofParameter< void > & getVoid(const std::string &name)
std::vector< std::shared_ptr< ofAbstractParameter > >::reverse_iterator rbegin()
Definition ofParameterGroup.cpp:516
ofParameterGroup(const std::string &name)
Definition ofParameter.h:89
ofParameter holds a value and notifies its listeners when it changes.
Definition ofParameter.h:492
ofParameter< ParameterType > & operator/=(const OtherType &v)
Definition ofParameter.h:937
ofParameter< ParameterType > & operator=(const ofParameter< ParameterType > &v)
Definition ofParameter.h:684
ofParameter< ParameterType > & set(const ParameterType &v)
Definition ofParameter.h:696
ofParameter< ParameterType > & operator>>=(const OtherType &v)
Definition ofParameter.h:985
void makeReferenceTo(ofParameter< ParameterType > &mom)
Definition ofParameter.h:992
ofParameter< ParameterType > & set(const std::string &name, const ParameterType &v)
Definition ofParameter.h:712
const ofParameterGroup getFirstParent() const
Definition ofParameter.h:586
ofParameter< ParameterType > & operator-=(const OtherType &v)
Definition ofParameter.h:921
ofParameter< ParameterType > & operator%=(const OtherType &v)
Definition ofParameter.h:945
const ParameterType & operator=(const ParameterType &v)
Definition ofParameter.h:690
ofParameter< ParameterType > & setWithoutEventNotifications(const ParameterType &v)
Definition ofParameter.h:719
ofParameter(const ofParameter< ParameterType > &v)
Definition ofParameter.h:663
ofParameter< ParameterType > & operator<<=(const OtherType &v)
Definition ofParameter.h:977
ofParameter(const std::string &name, const ParameterType &v, const ParameterType &min, const ParameterType &max)
Definition ofParameter.h:678
ofParameter(const std::string &name, const ParameterType &v)
Definition ofParameter.h:673
ofParameter< ParameterType > & operator^=(const OtherType &v)
Definition ofParameter.h:969
ofParameter< ParameterType > & set(const std::string &name, const ParameterType &v, const ParameterType &min, const ParameterType &max)
Definition ofParameter.h:702
ofParameter< ParameterType > & operator+=(const OtherType &v)
Definition ofParameter.h:913
std::shared_ptr< ofAbstractParameter > newReference() const
Definition ofParameter.h:997
ofParameter< ParameterType > & operator|=(const OtherType &v)
Definition ofParameter.h:961
void addListener(ListenerClass *listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofParameter.h:518
ofParameter< ParameterType > & operator&=(const OtherType &v)
Definition ofParameter.h:953
std::unique_ptr< of::priv::AbstractEventToken > newListener(Args...args)
Definition ofParameter.h:528
ofParameter< ParameterType > & operator*=(const OtherType &v)
Definition ofParameter.h:929
void removeListener(ListenerClass *listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofParameter.h:523
ofReadOnlyParameter holds a value and notifies its listeners when it changes.
Definition ofParameter.h:1107
const ParameterType * operator->() const
Definition ofParameter.h:1247
ofReadOnlyParameter< ParameterType, Friend > & operator%=(const OtherType &v)
Definition ofParameter.h:1418
ofReadOnlyParameter< ParameterType, Friend > & operator|=(const OtherType &v)
Definition ofParameter.h:1432
void makeReferenceTo(ofReadOnlyParameter< ParameterType, OtherFriend > mom)
Definition ofParameter.h:1338
friend class ofReadOnlyParameter
Definition ofParameter.h:1213
ofReadOnlyParameter< ParameterType, Friend > & operator--()
Definition ofParameter.h:1383
void removeListener(ListenerClass *listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofParameter.h:1295
std::unique_ptr< of::priv::AbstractEventToken > newListener(Args...args)
Definition ofParameter.h:1302
ofReadOnlyParameter< ParameterType, Friend > & operator-=(const OtherType &v)
Definition ofParameter.h:1397
ofReadOnlyParameter< ParameterType, Friend > & operator=(const ofReadOnlyParameter< ParameterType, Friend > &v)
Definition ofParameter.h:1348
void setParent(ofParameterGroup &_parent)
Definition ofParameter.h:1505
ofReadOnlyParameter< ParameterType, Friend > & operator<<=(const OtherType &v)
Definition ofParameter.h:1446
ofReadOnlyParameter< ParameterType, Friend > & operator*=(const OtherType &v)
Definition ofParameter.h:1404
const ofParameterGroup getFirstParent() const
Definition ofParameter.h:1198
ofReadOnlyParameter< ParameterType, Friend > & operator>>=(const OtherType &v)
Definition ofParameter.h:1453
void addListener(ListenerClass *listener, ListenerMethod method, int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofParameter.h:1288
ofReadOnlyParameter< ParameterType, Friend > & operator++()
Definition ofParameter.h:1372
std::shared_ptr< ofAbstractParameter > newReference() const
Definition ofParameter.h:1500
ofReadOnlyParameter< ParameterType, Friend > & set(const ParameterType &v)
Definition ofParameter.h:1461
ofReadOnlyParameter< ParameterType, Friend > & operator/=(const OtherType &v)
Definition ofParameter.h:1411
const void * getInternalObject() const
Definition ofParameter.h:1202
ofReadOnlyParameter< ParameterType, Friend > & operator^=(const OtherType &v)
Definition ofParameter.h:1439
ofReadOnlyParameter< ParameterType, Friend > & operator&=(const OtherType &v)
Definition ofParameter.h:1425
ofReadOnlyParameter< ParameterType, Friend > & operator+=(const OtherType &v)
Definition ofParameter.h:1390
Definition ofVec4f.h:11
Definition ofVectorMath.h:121
auto yes(Args &&... args) -> decltype(bernoulli(std::forward< Args >(args)...))
Definition ofRandomDistributions.h:500
Definition ofEvents.cpp:625
Definition ofPixels.h:1522
void ofRemoveListener(EventType &event, ListenerClass *listener, void(ListenerClass::*listenerMethod)(const void *, ArgumentsType &), int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofEventUtils.h:120
bool ofNotifyEvent(EventType &event, ArgumentsType &args, SenderType *sender)
Definition ofEventUtils.h:207
void ofAddListener(EventType &event, ListenerClass *listener, void(ListenerClass::*listenerMethod)(const void *, ArgumentsType &), int prio=OF_EVENT_ORDER_AFTER_APP)
Definition ofEventUtils.h:19
std::ostream & operator<<(std::ostream &os, const ofMatrix3x3 &M)
Definition ofMatrix3x3.cpp:304