Rhino C++ API  8.7
Public Member Functions | List of all members
IRhinoUiDataSourceHost Class Referenceabstract

#include <RhRdkDataSource.h>

Inheritance diagram for IRhinoUiDataSourceHost:
IRhinoUiDataSourceEventWatcher IRhinoUiController

Public Member Functions

virtual void AddDataSource (class IRhinoUiDataSource &ds)=0
 
virtual void Commit (const UUID &uuidData, IRhinoUiEventInfo *pInfo=nullptr)=0
 
virtual void CopyDataSourcesFrom (IRhinoUiDataSourceHost &host)=0
 
virtual void Discard (const UUID &uuidData)=0
 
virtual void * GetData (const UUID &uuidData, bool bForWrite, bool bAutoChangeBracket=true) const =0
 
virtual void GetDataSources (ON_SimpleArray< IRhinoUiDataSource * > &aOut) const =0
 
virtual void RemoveDataSource (IRhinoUiDataSource &ds)=0
 
- Public Member Functions inherited from IRhinoUiDataSourceEventWatcher
virtual void Delete (void)=0
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)=0
 
virtual void OnEvent (const UUID &uuidData, const IRhinoUiEventInfo *pInfo)=0
 

Additional Inherited Members

- Protected Member Functions inherited from IRhinoUiDataSourceEventWatcher
virtual ~IRhinoUiDataSourceEventWatcher ()
 

Detailed Description

A data source host is an object, usually a controller, that hosts one or more data sources. These data sources allow the host to get or set data that is stored somewhere, often in a document. All data source hosts are automatically also data source event watchers which means they can be notified when the data changes. A data source host can host any number of data sources, each one capable of providing different data types. Note that the host does not own the data sources, it simply stores references to them.

Member Function Documentation

◆ AddDataSource()

virtual void IRhinoUiDataSourceHost::AddDataSource ( class IRhinoUiDataSource ds)
pure virtual

Add a data source to the host. The implementation of this method typically also registers the host as a data source event watcher.

◆ Commit()

virtual void IRhinoUiDataSourceHost::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()

◆ CopyDataSourcesFrom()

virtual void IRhinoUiDataSourceHost::CopyDataSourcesFrom ( IRhinoUiDataSourceHost host)
pure virtual

Copy the data sources from another host. The implementation of this method typically also registers this host as a data source event watcher.

◆ Discard()

virtual void IRhinoUiDataSourceHost::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()

◆ GetData()

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

Get data, specified by a unique id, from one of the host's data source(s). Each data source will be asked to provide the data until either one provides it or there are no more data sources to ask.

Parameters
uuidDatais the identifier of the data.
bForWriteis true if the data source is going to be written to. Every call to GetData() with bForWrite=true must be matched by a call to either Commit() or Discard().
bAutoChangeBracketis true if a content change bracket should be applied.
Returns
The data from a data source or null if no such data could be provided.

◆ GetDataSources()

virtual void IRhinoUiDataSourceHost::GetDataSources ( ON_SimpleArray< IRhinoUiDataSource * > &  aOut) const
pure virtual

Get the data sources that are being hosted.

◆ RemoveDataSource()

virtual void IRhinoUiDataSourceHost::RemoveDataSource ( IRhinoUiDataSource ds)
pure virtual

Removes a data source from the host. This is called when a data source is being deleted. The implementation of this method typically also unregisters the host as a data source event watcher.