ULAPI  8.0
Public Member Functions | List of all members
ULDataSource Class Referenceabstract

ULDataSource is the abstract parent for classes that interface with data stored somewhere like a .uld or .ulc/.ull file or a database. More...

#include <uldatasource.h>

Public Member Functions

virtual ~ULDataSource ()
 
virtual ULError attach (const ULString &dataSourceIdentifier)=0
 
virtual ULError detach ()=0
 
virtual ULError load ()=0
 
virtual ULError close ()=0
 
virtual ULString getDataSourceIdentifier ()=0
 
virtual ULDataSourceVersion getVersion ()=0
 
- Public Member Functions inherited from ULLockable
 ULLockable ()
 
 ULLockable (const ULLockable &lockable)
 
virtual ~ULLockable ()
 
const ULLockableoperator= (const ULLockable &lockable)
 
void clear ()
 
ULLockgetLock ()
 
void setLock (ULLock *newLock)
 

Additional Inherited Members

- Protected Attributes inherited from ULLockable
ULLocklock
 

Detailed Description

ULDataSource is the abstract parent for classes that interface with data stored somewhere like a .uld or .ulc/.ull file or a database.

Constructor & Destructor Documentation

virtual ULDataSource::~ULDataSource ( )
inlinevirtual

Member Function Documentation

virtual ULError ULDataSource::attach ( const ULString dataSourceIdentifier)
pure virtual

Causes this ULDataSource object to be associated with the specified data source, and reads enough information from that data source to determine its language(s), etc.

The exact behavior of attach will be dependent on the nature of the data source. If the data source is a file, then attach will read header information from the file and then close the file to save memory until the data source is actually needed. On the other hand, if the data source is a remote database, then attach might open a connection, collect header information, and then close the connection.

Returns
ULError::NoError if the attachment is successful, or some other ULError value if not.
Parameters
[in]dataSourceIdentifierA string describing the data source (e.g. a file name, a database connection string, a URL, etc.).

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULLanguageDataSource.

virtual ULError ULDataSource::close ( )
pure virtual

Frees dynamically allocated memory associated with this data source while keeping it attached to the file, db, etc. to which it was previously attached. Also closes any relevant files, db connections, etc.

Returns
ULError::NoError if the memory freeing was successful.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULLanguageDataSource.

virtual ULError ULDataSource::detach ( )
pure virtual

Releases the connection between this ULDataSource object and the data source specified in the previous open() or attach() call, closing any relevant files or network connections and freeing memory in the process.

Returns
ULError::NoError if the attachment is successful, or some other ULError value if not.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULLanguageDataSource.

virtual ULString ULDataSource::getDataSourceIdentifier ( )
pure virtual
Returns
the data source identifier for the data source attached to this ULDataSource object, or the empty string if no data source is attached.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULLanguageDataSource.

virtual ULDataSourceVersion ULDataSource::getVersion ( )
pure virtual
Returns
the ULDataSourceVersion associated with this data source.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULLanguageDataSource.

virtual ULError ULDataSource::load ( )
pure virtual

Perform one-time opening and loading operations. Normally, such operations are performed lazily, when the data source is first queried. If you would prefer to control the time at which loading is performed, call this method.

Returns
ULError::NoError if the loading was successful.

Implemented in ULDictionaryDataSource, ULJSONDictionaryDataSource, and ULLanguageDataSource.


The documentation for this class was generated from the following file: