1 #ifndef attribparamgroup_h 2 #define attribparamgroup_h 52 const char*
errMsg()
const;
58 const Param&
operator[](
int idx )
const {
return *params_[idx];}
61 int size()
const {
return sz_; }
63 const char*
getPrefix()
const {
return prefix_.buf();}
67 bool isEqual(
const Param&)
const;
80 #define mDescGetParamGroup(PT,ret,desc,key) \ 81 ParamGroup<PT>* ret; \ 83 Param* param = desc.getParam( key ); \ 84 mDynamicCastGet(ParamGroup<PT>*,tmp,param) \ 88 #define mDescGetConstParamGroup(PT,ret,desc,key) \ 89 const ParamGroup<PT>* ret; \ 91 const Param* param = desc.getParam( key ); \ 92 mDynamicCastGet(const ParamGroup<PT>*,tmp,param)\ 105 template <
class PT>
inline 109 if ( !pgr || pgr->size() != sz_ )
111 if ( prefix_ != pgr->getPrefix() )
114 for (
int idx=0; idx<sz_; idx++ )
116 if ( params_[idx]->getSpec()->nElems()
117 != pgr->params_[idx]->getSpec()->nElems() )
121 idy<params_[idx]->getSpec()->nElems(); idy++ )
123 const BufferString txt( params_[idx]->getSpec()->text(idx) );
124 if ( txt != pgr->params_[idx]->getSpec()->text(idx) )
132 template <
class PT>
inline 135 if ( !enabled_ )
return true;
136 if ( !sz_ )
return false;
138 for (
int idx=0; idx<sz_; idx++ )
140 if ( !params_[idx]->isOK() )
143 err =
"cannot parse parameter "; err += idx;
144 err +=
" of the group "; err += prefix_;
153 template <
class PT>
inline 156 setSize( vals.
size() );
157 for (
int idx=0; idx<sz_; idx++ )
159 if ( !params_[idx]->setCompositeValue(vals.
get(idx) ) )
167 template <
class PT>
inline 174 template <
class PT>
inline 179 template <
class PT>
inline 190 template <
class PT>
inline 199 PT* np =
new PT( (PT&)a[idx] );
205 template <
class PT>
inline 212 template <
class PT>
inline 219 template <
class PT>
inline 224 PT* newpara =
new PT(
templ_);
232 template <
class PT>
inline 235 for (
int idx=0; idx<
sz_; idx++ )
240 res.
add( parstr ).
add(
" " );
246 template <
class PT>
inline 249 for (
int idx=0; idx<
sz_; idx++ )
255 val =
params_[idx]->getDefaultValue();
256 res.
add( val ).
add(
" " );
261 #define mAttribSpecSet(sizegiver,sizetaker) \ 265 if ( sizegiver == sizetaker.size() ) \ 268 sizetaker.setSize( sizegiver ); \ bool setValues(BufferStringSet &)
Definition: attribparamgroup.h:154
bool isEqual(const Param &) const
Definition: attribparamgroup.h:106
const char * str() const
Definition: odstring.h:48
const char * errMsg() const
Definition: attribparamgroup.h:175
Set of BufferString objects.
Definition: bufstringset.h:28
bool isRequired() const
Definition: attribparambase.h:54
ParamGroup(int startsz, const char *prefix, const PT &templ)
Definition: attribparamgroup.h:180
ObjectSet< PT > params_
Definition: attribparamgroup.h:73
FixedString getKey() const
Definition: attribparambase.h:58
size_type size() const
Definition: objectset.h:50
BufferString errmsg_
Definition: attribparamgroup.h:75
bool getCompositeValue(BufferString &) const
Definition: attribparamgroup.h:233
int getSize() const
Definition: attribparamgroup.h:213
~ParamGroup()
Definition: attribparamgroup.h:206
const BufferString prefix_
Definition: attribparamgroup.h:71
A parameter that is used by an attribute.
Definition: attribparambase.h:36
const char * getPrefix() const
Definition: attribparamgroup.h:63
int size() const
Definition: attribparamgroup.h:61
#define mDynamicCastGet(typ, out, in)
Definition: commondefs.h:131
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString errmsg_
Definition: horizontracker.h:119
int isEmpty() const
Definition: attribparamgroup.h:62
ParamGroup< PT > * clone() const
Definition: attribparamgroup.h:168
bool isgroup_
Definition: attribparambase.h:77
bool isOK() const
Definition: attribparamgroup.h:133
BufferString & get(int idx)
Definition: bufstringset.h:36
const char * errMsg() const
Definition: horizontracker.h:61
#define mClass(module)
Definition: commondefs.h:164
void setSize(int)
Definition: attribparamgroup.h:220
Attrib::Param that contains many (a set) Attrib::Param of one kind.
Definition: attribparamgroup.h:41
void fillDefStr(BufferString &) const
Definition: attribparamgroup.h:247
Param & operator[](int idx)
Definition: attribparamgroup.h:57
Semblance Attribute.
Definition: attribdataholder.h:25
void deepErase(ObjectSet< T > &os)
empty the ObjectSet deleting all objects pointed to.
Definition: objectset.h:118
int sz_
Definition: attribparamgroup.h:69
PT templ_
Definition: attribparamgroup.h:72
const Param & operator[](int idx) const
Definition: attribparamgroup.h:58