Rhino C++ API  8.13
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
IRhinoUiDataSource Class Referenceabstract

#include <RhRdkDataSource.h>

Public Member Functions

virtual void AddHost (IRhinoUiDataSourceHost &h)=0
 
virtual void Commit (const UUID &uuidData, IRhinoUiEventInfo *pInfo=nullptr)=0
 
virtual void DeleteThis (void)=0
 
virtual void Discard (const UUID &uuidData)=0
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)=0
 
virtual void * GetData (const UUID &uuidData, bool bForWrite, bool bAutoChangeBracket=true) const =0
 
virtual void RegisterEventWatcher (IRhinoUiDataSourceEventWatcher &ew)=0
 
virtual void RemoveHost (IRhinoUiDataSourceHost &h)=0
 
virtual RDK_DEPRECATED bool ResetToDefaults (void)=0
 
virtual bool SetChanged (void)=0
 
virtual void UnregisterEventWatcher (IRhinoUiDataSourceEventWatcher &ew)=0
 

Static Public Member Functions

static void Deleter (IRhinoUiDataSource *)
 

Protected Member Functions

virtual ~IRhinoUiDataSource ()
 

Detailed Description

Data source for user interfaces. A UI can have any number of data sources.

Constructor & Destructor Documentation

◆ ~IRhinoUiDataSource()

virtual IRhinoUiDataSource::~IRhinoUiDataSource ( )
inlineprotectedvirtual

Member Function Documentation

◆ AddHost()

virtual void IRhinoUiDataSource::AddHost ( IRhinoUiDataSourceHost h)
pure virtual

Called when the data source is added to a data source host.

◆ Commit()

virtual void IRhinoUiDataSource::Commit ( const UUID &  uuidData,
IRhinoUiEventInfo pInfo = nullptr 
)
pure virtual

Commit changes made using GetData() with bForWrite=true.

Parameters
uuidDatais the identifier of the data.
pInfois a pointer to optional info to be sent with any event that is raised. Events will be sent for any data objects that have had data committed. Every call to GetData() with bForWrite=true must be matched by a call to either Commit() or Discard(). This method should not be called if the operation is cancelled. Instead you should call Discard().
See also
GetData()
Discard()

◆ Deleter()

static void IRhinoUiDataSource::Deleter ( IRhinoUiDataSource )
static

For use with smart pointers.

◆ DeleteThis()

virtual void IRhinoUiDataSource::DeleteThis ( void  )
pure virtual

You must implement this method as

delete this;

◆ Discard()

virtual void IRhinoUiDataSource::Discard ( const UUID &  uuidData)
pure virtual

Discard changes made using GetData() with bForWrite=true.

Parameters
uuidDatais the identifier of the data. Every call to GetData() with bForWrite=true must be matched by a call to either Commit() or Discard(). This method should only be called if the operation is cancelled. Otherwise you should call Commit().
See also
GetData()
Commit()

◆ EVF()

virtual void* IRhinoUiDataSource::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
pure virtual

Emergency virtual function for future expansion.

◆ GetData()

virtual void* IRhinoUiDataSource::GetData ( const UUID &  uuidData,
bool  bForWrite,
bool  bAutoChangeBracket = true 
) const
pure virtual

Get data specified by a unique id.

Parameters
uuidDatais the identifier of the data. UUIDs defined by Rhino are specified above.
bForWritespecifies if you intend to write to the data.
See also
Commit()
Discard.
Parameters
bAutoChangeBracketis true if you want BeginChange() and EndChange() to be called automatically when the data is contents.
Returns
a pointer which can be cast to the type for the identifier as documented above. Note that this method will return null if the requested data type cannot be provided.

◆ RegisterEventWatcher()

virtual void IRhinoUiDataSource::RegisterEventWatcher ( IRhinoUiDataSourceEventWatcher ew)
pure virtual

Add a data source host which would like to be notified of events that affect its data. When such an event arrives, the data source checks if the host is interested in the event and if so, it calls the host's OnEvent() method.

◆ RemoveHost()

virtual void IRhinoUiDataSource::RemoveHost ( IRhinoUiDataSourceHost h)
pure virtual

Called by a data source host when it is being deleted.

◆ ResetToDefaults()

virtual RDK_DEPRECATED bool IRhinoUiDataSource::ResetToDefaults ( void  )
pure virtual

◆ SetChanged()

virtual bool IRhinoUiDataSource::SetChanged ( void  )
pure virtual

Set the data source as changed. This must be called in between GetData() with bForWrite == true and Commit() in order for the commit to succeed and an event to be sent. If it is called when the data source is not in write mode, the call will fail.

Returns
true if successful, else false.

◆ UnregisterEventWatcher()

virtual void IRhinoUiDataSource::UnregisterEventWatcher ( IRhinoUiDataSourceEventWatcher ew)
pure virtual

Remove a data source host which has been added by RegisterEventWatcher(). This must be done when such a host is deleted.