Poco::OSP

class PreferencesService

File Information

Library: OSP
Package: PreferencesService
Header: Poco/OSP/PreferencesService.h

Description

The PreferencesService provides an easy way for a bundle or service to retrieve and store configuration information. It also gives a bundle or service read-only access to the global application configuration.

The service name of the PreferencesService is "osp.core.preferences".

Inheritance

Direct Base Classes: Service

All Base Classes: Service, Poco::RefCountedObject

Member Summary

Member Functions: configuration, isA, preferences, type

Inherited Functions: duplicate, isA, referenceCount, release, type

Types Aliases

ConstPtr

using ConstPtr = const Ptr;

Ptr

using Ptr = Poco::AutoPtr < PreferencesService >;

Constructors

PreferencesService

PreferencesService(
    const Poco::Path & persistencyDir,
    Poco::Util::AbstractConfiguration * pGlobalConfig
);

Creates the PreferencesService, usign the given global configuration.

Destructor

~PreferencesService protected virtual

~PreferencesService();

Destroys the PreferencesService.

Member Functions

configuration

Configuration::Ptr configuration();

Returns the global application configuration.

isA virtual

bool isA(
    const std::type_info & otherType
) const;

preferences

Preferences::Ptr preferences(
    const std::string & bundleOrServiceID
);

Returns the preferences object for the given bundle or service. A bundle should specify its symbolic name as ID. A service should specify its service name.

type virtual

const std::type_info & type() const;

Variables

SERVICE_NAME static

static const std::string SERVICE_NAME;

Securely control IoT edge devices from anywhere   Connect a Device