service/session/interface.h
Go to the documentation of this file.
/*
* Copyright © 2012-2013 Canonical Ltd.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License version 3,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* Authored by: Thomas Voß <thomas.voss@canonical.com>
*/
#ifndef LOCATION_SERVICE_COM_LOMIRI_LOCATION_SERVICE_SESSION_INTERFACE_H_
#define LOCATION_SERVICE_COM_LOMIRI_LOCATION_SERVICE_SESSION_INTERFACE_H_
#include <com/lomiri/location/heading.h>
#include <com/lomiri/location/position.h>
#include <com/lomiri/location/provider.h>
#include <com/lomiri/location/update.h>
#include <com/lomiri/location/velocity.h>
#include <core/property.h>
namespace com
{
namespace lomiri
{
namespace location
{
namespace service
{
namespace session
{
class Interface
{
public:
struct UpdatePosition;
struct UpdateVelocity;
struct UpdateHeading;
struct StartPositionUpdates;
struct StopPositionUpdates;
struct StartVelocityUpdates;
struct StopVelocityUpdates;
struct StartHeadingUpdates;
struct StopHeadingUpdates;
struct Errors
{
struct ErrorParsingUpdate;
struct ErrorStartingUpdate;
};
struct Updates
{
enum class Status
{
enabled,
disabled
};
core::Property<Update<Position>> position{};
core::Property<Status> position_status{Status::disabled};
core::Property<Update<Heading>> heading{};
core::Property<Status> heading_status{Status::disabled};
core::Property<Update<Velocity>> velocity{};
core::Property<Status> velocity_status{Status::disabled};
};
typedef std::shared_ptr<Interface> Ptr;
Interface(const Interface&) = delete;
virtual ~Interface() noexcept;
Interface& operator=(const Interface&) = delete;
virtual Updates& updates();
protected:
Interface();
private:
struct Private;
std::shared_ptr<Private> d;
};
}
}
}
}
}
#endif // LOCATION_SERVICE_COM_LOMIRI_LOCATION_SERVICE_SESSION_INTERFACE_H_
com::lomiri::location::service::session::Interface::Interface
Interface(const Interface &)=delete
com::lomiri::location::service::session::Interface::Ptr
std::shared_ptr< Interface > Ptr
Definition service/session/interface.h:105
com::lomiri::location::service::session::Interface::updates
virtual Updates & updates()
Provides access to the updates delivered for this session.
com::lomiri::location::service::session::Interface::~Interface
virtual ~Interface() noexcept
heading.h
com::lomiri::location::service::session
Definition implementation.h:36
com::lomiri::location::service
Definition service/configuration.h:36
com::lomiri::location
Definition accuracy.h:28
com::lomiri
Definition accuracy.h:26
com
Definition accuracy.h:24
position.h
provider.h
com::lomiri::location::service::session::Interface::Errors
Definition service/session/interface.h:59
com::lomiri::location::service::session::Interface::Updates
Encapsulates updates provided for this session, and the ability to enable/disable updates.
Definition service/session/interface.h:67
com::lomiri::location::service::session::Interface::Updates::velocity_status
core::Property< Status > velocity_status
Status of velocity updates, mutable.
Definition service/session/interface.h:102
com::lomiri::location::service::session::Interface::Updates::Status
Status
The Status enum models the possible states of updates.
Definition service/session/interface.h:72
com::lomiri::location::service::session::Interface::Updates::Status::disabled
@ disabled
Updates are disabled and not delivered to this session.
Definition service/session/interface.h:74
com::lomiri::location::service::session::Interface::Updates::Status::enabled
@ enabled
Updates are enabled and delivered to this session.
Definition service/session/interface.h:73
com::lomiri::location::service::session::Interface::Updates::heading_status
core::Property< Status > heading_status
Status of position updates, mutable.
Definition service/session/interface.h:93
com::lomiri::location::service::session::Interface::Updates::velocity
core::Property< Update< Velocity > > velocity
Updates for velocity measurements.
Definition service/session/interface.h:98
com::lomiri::location::service::session::Interface::Updates::position_status
core::Property< Status > position_status
Status of position updates, mutable.
Definition service/session/interface.h:84
com::lomiri::location::service::session::Interface::Updates::heading
core::Property< Update< Heading > > heading
Updates for the heading measurements.
Definition service/session/interface.h:89
com::lomiri::location::service::session::Interface::Updates::position
core::Property< Update< Position > > position
Updates for position measurements.
Definition service/session/interface.h:80
update.h
velocity.h