Skip to content

Commit 6530c62

Browse files
committed
added method to hide a property at runtime
1 parent 614a014 commit 6530c62

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/core/flux_base/flxCoreProps.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ class flxProperty : public flxDescriptor
6363
virtual flxDataVariable getValue(void) = 0;
6464

6565
virtual bool hidden(void) = 0;
66+
virtual void setHidden(void) = 0;
6667
virtual bool secure(void) = 0;
6768
//---------------------------------------------------------------------------------
6869
virtual size_t size(void)
@@ -209,6 +210,16 @@ class _flxPropertyContainer
209210
return totalSize;
210211
};
211212

213+
//---------------------------------------------------------------------------------
214+
// method to hide a property.
215+
void hideProperty(flxProperty &theProp)
216+
{
217+
theProp.setHidden();
218+
// deal with hidden property optimization..
219+
removeProperty(theProp);
220+
addProperty(theProp);
221+
}
222+
212223
private:
213224
flxPropertyList _properties;
214225

@@ -247,6 +258,11 @@ class _flxPropertyBase : public flxProperty, public _flxDataIn<T>, public _flxDa
247258
{
248259
return _isHidden;
249260
}
261+
// Add a method that allows the property to be hidden if public
262+
void setHidden(void)
263+
{
264+
_isHidden = true;
265+
}
250266
bool secure()
251267
{
252268
return _isSecure;
@@ -394,6 +410,11 @@ class _flxPropertyBaseString : public flxProperty, _flxDataInString, _flxDataOut
394410
{
395411
return _isHidden;
396412
}
413+
// Add a method that allows the property to be hidden if public
414+
void setHidden(void)
415+
{
416+
_isHidden = true;
417+
}
397418
bool secure()
398419
{
399420
return _isSecure;

0 commit comments

Comments
 (0)