NERvDN Library  0.2.0.20160420-0019
NERvLibrary - Nerve Gear Developer Network
NERvGear::IDataSource Struct Referenceabstract

Nerve Gear data source interface. More...

#include <NERvGear/interface/IDataSource.h>

Inheritance diagram for NERvGear::IDataSource:
NERvGear::IUnknown GPBeta::OCoreTempDataSource GPBeta::OSpeedFanDataSource GPBeta::OWeatherDataSource NERvGear::ODataSource RangerCD::OMusicPlayerDataSource RangerCD::OPdhDataSource RangerCD::OShortcutKeysDataSource

Detailed Description

Nerve Gear data source interface.

Define ID:

const NERvGear::UID NERvGear::ID_IDataSource; // 00000001-4900-6144-7461-536f75726365

Public Member Functions

virtual long __stdcall GetId (UID *id)=0
 Retrieves the UID of this data source object. More...
 
virtual size_t __stdcall GetName (size_t len, wchar_t *name)=0
 Retrieves the display name for this data source. More...
 
virtual size_t __stdcall GetDescrip (size_t len, wchar_t *descrip)=0
 Retrieves the description for this data source. More...
 
virtual unsigned __stdcall GetDataCount ()=0
 Retrieves the number of data providing by this data source.
 
virtual long __stdcall GetData (unsigned index, IData **data)=0
 Retrieves a data represented by index. More...
 
virtual long __stdcall FindData (const UID &id, IData **data)=0
 Retrieves a data indicated by UID. More...
 
- Public Member Functions inherited from NERvGear::IUnknown
virtual long __stdcall QueryInterface (const UID &interfaceID, void **ppvObject)=0
 
virtual unsigned long __stdcall AddRef ()=0
 
virtual unsigned long __stdcall Release ()=0
 

Member Function Documentation

virtual long __stdcall NERvGear::IDataSource::FindData ( const UID id,
IData **  data 
)
pure virtual

Retrieves a data indicated by UID.

Parameters
[in]idA UID reference associating with a data.
[out]dataA pointer to a buffer receiving the IData pointer.
Remarks
See IDataSource::GetData() for more details about parameters and return values.
See also
IData::GetId()
virtual long __stdcall NERvGear::IDataSource::GetData ( unsigned  index,
IData **  data 
)
pure virtual

Retrieves a data represented by index.

Parameters
[in]indexA zero based number identifying a data locally.
[out]dataA pointer to a buffer receiving the IData pointer.
Return values
S_OKSuccess.
E_INVALIDARGFail. The index is invalid or the data parameter is NULL.
E_FAILFailed with unknown error.
virtual size_t __stdcall NERvGear::IDataSource::GetDescrip ( size_t  len,
wchar_t *  descrip 
)
pure virtual

Retrieves the description for this data source.

Remarks
See IDataSource::GetName() for more details about parameters and return values.
virtual long __stdcall NERvGear::IDataSource::GetId ( UID id)
pure virtual

Retrieves the UID of this data source object.

Parameters
[out]idPointer to a UID, must not be NULL.
Return values
S_OKSuccess.
E_INVALIDARGFail. The id is NULL.
E_FAILFailed with unknown error.
Note
The returned ID must be the same as the object ID specified in the object declaration.
virtual size_t __stdcall NERvGear::IDataSource::GetName ( size_t  len,
wchar_t *  name 
)
pure virtual

Retrieves the display name for this data source.

Parameters
[in]lenThe size of the name buffer, in characters. If name is NULL, this parameter must be 0.
[out]nameA pointer to a buffer that receives the null terminated string for the display name, could be NULL.
Returns
Returns the size copied into the name buffer, in characters.
If name is not NULL, the return value is the length of the string that is copied to the buffer, in characters, not including the terminating null character.
If name buffer is too small to hold the name, the string is truncated to len characters including the terminating null character, and the return value is len.
If name is NULL and len is 0, the return value is the length of the string buffer required, in characters, including the terminating null character.
If the function fails, the return value is 0.
See also
NERvCopyString()