nx_server_plugin_sdk 1.0 Server Plugin SDK

Public Member Functions | Protected Attributes | List of all members
TestStorageFactory Class Reference
Inheritance diagram for TestStorageFactory:

## Public Member Functions
virtual const char **STORAGE_METHOD_CALL | findAvailable () const override
virtual nx_spl::Storage *STORAGE_METHOD_CALL | createStorage (const char *url, int *ecode) override
virtual const char *STORAGE_METHOD_CALL | storageType () const override
virtual const char * | lastErrorMessage (int ecode) const override
virtual void * | queryInterface (const nxpl::NX_GUID &interfaceID) override
| Cast to type, specified by interfaceID. More...
virtual int | addRef () const override
| Increment reference counter. More...
virtual int | releaseRef () const override
| Decrement reference counter. More...
Public Member Functions inherited from PluginRefCounter< TestStorageFactory >
int | pAddRef () const
int | pReleaseRef () const

## Protected Attributes
std::unordered_set< std::string > | m_storageHosts
std::mutex | m_storageHostsMutex

## Member Function Documentation

## ◆ addRef()

int TestStorageFactory::addRef | ( |  | ) | const
| override virtual

Increment reference counter.

Returns
  new reference count

Note
  PluginInterface::releaseRef is not guaranteed to be called from thread that called PluginInterface::addRef

Implements nxpl::PluginInterface.

## ◆ createStorage()

nx_spl::Storage *STORAGE_METHOD_CALL TestStorageFactory::createStorage | ( | const char * | url,
|  | int * | ecode
| ) |  |
| override virtual

Parameters

  url | Storage root URL. This should be NULL terminated utf8 encoded C string.
  ecode | Pointer to error code. Pass NULL if you are not interested in error information.

Returns
  pointer to Storage.

Implements nx_spl::StorageFactory.

## ◆ findAvailable()

const char **STORAGE_METHOD_CALL TestStorageFactory::findAvailable | ( |  | ) | const
| override virtual

Returns
  available utf8 encoded urls list. Iterate till NULL.

Implements nx_spl::StorageFactory.

## ◆ lastErrorMessage()

const char * TestStorageFactory::lastErrorMessage | ( | int | ecode | ) | const
| override virtual

Parameters

  ecode | Error code

Returns
  NULL terminated utf8 encoded C string

Implements nx_spl::StorageFactory.

## ◆ queryInterface()

void * TestStorageFactory::queryInterface | ( | const nxpl::NX_GUID & | interfaceID | ) |
| override virtual

Cast to type, specified by interfaceID.

If pointer cannot be cast, NULL MUST be returned

Returns
  If not NULL, returned pointer can be safely cast to type, defined by interfaceID

Note
  This method increments reference counter

Implements nxpl::PluginInterface.

## ◆ releaseRef()

int TestStorageFactory::releaseRef | ( |  | ) | const
| override virtual

Decrement reference counter.

When zero, object MUST be removed

Returns
  new reference count

Note
  PluginInterface::releaseRef is not guaranteed to be called from thread that called PluginInterface::addRef

Implements nxpl::PluginInterface.

## ◆ storageType()

const char *STORAGE_METHOD_CALL TestStorageFactory::storageType | ( |  | ) | const
| override virtual

Returns
  English name of the Storage type. This name can be shown to the user, but is not used programmatically, so it can be any human-readable name, like "local", "network", "smb", "ftp", "tape", etc.

Implements nx_spl::StorageFactory.

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

- samples/storage/test_storage_plugin/src/test_storage_factory.h
- samples/storage/test_storage_plugin/src/test_storage_factory.cpp