#include <primitive_class.h>
Inheritance diagram for NLLIGO::CPrimitiveClass::CParameter:

Public Types | |
| enum | TType { Boolean, ConstString, String, StringArray, ConstStringArray } |
Public Member Functions | |
| CParameter (const NLLIGO::IProperty &property, const char *propertyName) | |
| CParameter () | |
| bool | getDefaultValue (std::vector< std::string > &result, const IPrimitive &primitive, const CPrimitiveClass &primitiveClass, std::string *fromWhere=NULL) const |
| bool | getDefaultValue (std::string &result, const IPrimitive &primitive, const CPrimitiveClass &primitiveClass, std::string *fromWhere=NULL) const |
| bool | operator< (const CParameter &other) const |
| bool | operator== (const CParameter &other) const |
| bool | translateAutoname (std::string &result, const IPrimitive &primitive, const CPrimitiveClass &primitiveClass) const |
| Get the autoname translation. | |
Data Fields | |
| std::string | Autoname |
| std::map< std::string, CConstStringValue > | ComboValues |
| std::vector< CDefaultValue > | DefaultValue |
| Default value. | |
| bool | DisplayHS |
| std::string | FileExtension |
| bool | Filename |
| std::string | Folder |
| bool | Lookup |
| std::string | Name |
| Parameter name. | |
| bool | ReadOnly |
| Is parameter read only ? | |
| bool | SortEntries |
| enum NLLIGO::CPrimitiveClass::CParameter::TType | Type |
| bool | Visible |
| Is parameter visible ? | |
| uint | WidgetHeight |
|
|
Definition at line 141 of file primitive_class.h.
00142 {
00143 Boolean,
00144 ConstString,
00145 String,
00146 StringArray,
00147 ConstStringArray,
00148 } Type;
|
|
|
Definition at line 135 of file primitive_class.h.
00135 {}
|
|
||||||||||||
|
Definition at line 546 of file primitive_class.cpp. References Visible.
00547 {
00548 Name = propertyName;
00549 Filename = false;
00550 Visible = true;
00551 Type = (typeid (property) == typeid (CPropertyString)) ? CPrimitiveClass::CParameter::String : CPrimitiveClass::CParameter::StringArray;
00552 }
|
|
||||||||||||||||||||
|
Definition at line 715 of file primitive_class.cpp. References Autoname, translateAutoname(), and uint.
00716 {
00717 if (!Autoname.empty())
00718 {
00719 string temp;
00720 if (translateAutoname (temp, primitive, primitiveClass))
00721 {
00722 result.clear ();
00723 if (!temp.empty())
00724 {
00725 string tmp;
00726 uint i;
00727 for (i=0; i<temp.size(); i++)
00728 {
00729 if (temp[i] == '\n')
00730 {
00731 result.push_back (tmp);
00732 tmp.clear();
00733 }
00734 else
00735 {
00736 tmp.push_back(temp[i]);
00737 }
00738 }
00739 if (!tmp.empty())
00740 result.push_back (tmp);
00741 }
00742 return true;
00743 }
00744 else
00745 return false;
00746 }
00747 else
00748 {
00749 uint i;
00750 result.resize (DefaultValue.size());
00751 for (i=0; i<DefaultValue.size(); i++)
00752 result[i] = DefaultValue[i].Name;
00753 }
00754 return true;
00755 }
|
|
||||||||||||||||||||
|
Definition at line 694 of file primitive_class.cpp. References Autoname, and translateAutoname(). Referenced by NLLIGO::IPrimitive::read().
00695 {
00696 result = "";
00697 if (!Autoname.empty())
00698 {
00699 if (fromWhere)
00700 *fromWhere = "Autoname value : "+Autoname;
00701 return translateAutoname (result, primitive, primitiveClass);
00702 }
00703 else
00704 {
00705 if (fromWhere)
00706 *fromWhere = "Default value";
00707 if (!DefaultValue.empty())
00708 result = DefaultValue[0].Name;
00709 }
00710 return true;
00711 }
|
|
|
Definition at line 570 of file primitive_class.cpp. References ComboValues, NLLIGO::CPrimitiveClass::CInitParameters::DefaultValue, Filename, NLLIGO::CPrimitiveClass::CInitParameters::Name, Type, and Visible.
00571 {
00572 return (Name < other.Name) ? true : (Name > other.Name) ? false :
00573 (Type < other.Type) ? true : (Type > other.Type) ? false :
00574 (Visible < other.Visible) ? true : (Visible > other.Visible) ? false :
00575 (Filename < other.Filename) ? true : (Filename > other.Filename) ? false :
00576 (ComboValues < other.ComboValues) ? true : (ComboValues > other.ComboValues) ? false :
00577 (DefaultValue < other.DefaultValue) ? true : (DefaultValue > other.DefaultValue) ? false :
00578 false;
00579 }
|
|
|
Definition at line 558 of file primitive_class.cpp. References ComboValues, NLLIGO::CPrimitiveClass::CInitParameters::DefaultValue, Filename, NLLIGO::CPrimitiveClass::CInitParameters::Name, Type, and Visible.
00559 {
00560 return (Type == other.Type) &&
00561 (Name == other.Name) &&
00562 (Visible == other.Visible) &&
00563 (Filename == other.Filename) &&
00564 (ComboValues == other.ComboValues) &&
00565 (DefaultValue == other.DefaultValue);
00566 }
|
|
||||||||||||||||
|
Get the autoname translation.
Definition at line 599 of file primitive_class.cpp. References Autoname, NLLIGO::IPrimitive::getPropertyByName(), NLLIGO::CPrimitiveClass::Parameters, NLLIGO::CPropertyString::String, NLLIGO::CPropertyStringArray::StringArray, and uint. Referenced by getDefaultValue().
00600 {
00601 result = "";
00602 uint strBegin = 0;
00603 uint strEnd = 0;
00604 while (strBegin != Autoname.size())
00605 {
00606 strEnd = Autoname.find ('$', strBegin);
00607 if (strEnd == string::npos)
00608 {
00609 strEnd = Autoname.size();
00610 result += Autoname.substr (strBegin, strEnd-strBegin);
00611 }
00612 else
00613 {
00614 // Copy the remaining string
00615 result += Autoname.substr (strBegin, strEnd-strBegin);
00616 if (strEnd != Autoname.size())
00617 {
00618 strBegin = strEnd+1;
00619 strEnd = Autoname.find ('$', strBegin);
00620 if (strEnd == string::npos)
00621 strEnd = Autoname.size();
00622 else
00623 {
00624 string keyWord = Autoname.substr (strBegin, strEnd-strBegin);
00625
00626 // Loop for the parameter
00627 uint i;
00628 for (i=0; i<primitiveClass.Parameters.size (); i++)
00629 {
00630 if (primitiveClass.Parameters[i].Name == keyWord)
00631 {
00632 // Get its string value
00633 string str;
00634 const IProperty *prop;
00635 if (primitive.getPropertyByName (keyWord.c_str(), prop))
00636 {
00637 // The property has been found ?
00638 if (prop)
00639 {
00640 // Array or string ?
00641 const CPropertyString *_string = dynamic_cast<const CPropertyString *>(prop);
00642
00643 // Is a string ?
00644 if (_string)
00645 {
00646 if (!(_string->String.empty()))
00647 {
00648 result += _string->String;
00649 break;
00650 }
00651 }
00652 else
00653 {
00654 // Try an array
00655 const CPropertyStringArray *array = dynamic_cast<const CPropertyStringArray *>(prop);
00656
00657 // Is an array ?
00658 if (array)
00659 {
00660 if (!(array->StringArray.empty()))
00661 {
00662 uint i;
00663 for (i=0; i<array->StringArray.size()-1; i++)
00664 result += array->StringArray[i] + "\n";
00665 result += array->StringArray[i];
00666 break;
00667 }
00668 }
00669 }
00670 }
00671 }
00672
00673 // Get its default value
00674 std::string result2;
00675 if (primitiveClass.Parameters[i].getDefaultValue (result2, primitive, primitiveClass))
00676 {
00677 result += result2;
00678 break;
00679 }
00680 }
00681 }
00682 strEnd++;
00683 }
00684
00685 }
00686 }
00687 strBegin = strEnd;
00688 }
00689 return true;
00690 }
|
|
|
Definition at line 166 of file primitive_class.h. Referenced by getDefaultValue(), NLLIGO::CPrimitiveClass::read(), and translateAutoname(). |
|
|
Definition at line 190 of file primitive_class.h. Referenced by operator<(), operator==(), and NLLIGO::CPrimitiveClass::read(). |
|
|
Default value.
Definition at line 128 of file primitive_class.h. Referenced by operator<(), operator==(), NLLIGO::CPrimitiveClass::read(), and ReadChild(). |
|
|
Definition at line 178 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
|
|
Definition at line 163 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
|
|
Definition at line 154 of file primitive_class.h. Referenced by operator<(), operator==(), and NLLIGO::CPrimitiveClass::read(). |
|
|
Definition at line 169 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
|
|
Definition at line 157 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
|
|
Parameter name.
Definition at line 125 of file primitive_class.h. Referenced by operator<(), operator==(), NLLIGO::CPrimitiveClass::read(), NLLIGO::IPrimitive::read(), and ReadChild(). |
|
|
Is parameter read only ?
Definition at line 160 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
|
|
Definition at line 175 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
|
|
Referenced by operator<(), operator==(), NLLIGO::CPrimitiveClass::read(), and NLLIGO::IPrimitive::read(). |
|
|
Is parameter visible ?
Definition at line 151 of file primitive_class.h. Referenced by CParameter(), operator<(), operator==(), and NLLIGO::CPrimitiveClass::read(). |
|
|
Definition at line 172 of file primitive_class.h. Referenced by NLLIGO::CPrimitiveClass::read(). |
1.3.6