Skip to content

Commit

Permalink
Create service package
Browse files Browse the repository at this point in the history
  • Loading branch information
f1xpl committed Apr 6, 2018
1 parent 675e6cf commit 478caf0
Show file tree
Hide file tree
Showing 36 changed files with 129 additions and 167 deletions.
12 changes: 6 additions & 6 deletions include/f1x/openauto/autoapp/App.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#include <f1x/aasdk/USB/USBWrapper.hpp>
#include <f1x/aasdk/TCP/ITCPWrapper.hpp>
#include <f1x/aasdk/TCP/ITCPEndpoint.hpp>
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntityEventHandler.hpp>
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntityFactory.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp>

namespace f1x
{
Expand All @@ -33,12 +33,12 @@ namespace openauto
namespace autoapp
{

class App: public projection::IAndroidAutoEntityEventHandler, public std::enable_shared_from_this<App>
class App: public service::IAndroidAutoEntityEventHandler, public std::enable_shared_from_this<App>
{
public:
typedef std::shared_ptr<App> Pointer;

App(boost::asio::io_service& ioService, aasdk::usb::USBWrapper& usbWrapper, aasdk::tcp::ITCPWrapper& tcpWrapper, projection::IAndroidAutoEntityFactory& androidAutoEntityFactory,
App(boost::asio::io_service& ioService, aasdk::usb::USBWrapper& usbWrapper, aasdk::tcp::ITCPWrapper& tcpWrapper, service::IAndroidAutoEntityFactory& androidAutoEntityFactory,
aasdk::usb::IUSBHub::Pointer usbHub, aasdk::usb::IConnectedAccessoriesEnumerator::Pointer connectedAccessoriesEnumerator);

void waitForUSBDevice();
Expand All @@ -57,10 +57,10 @@ class App: public projection::IAndroidAutoEntityEventHandler, public std::enable
aasdk::usb::USBWrapper& usbWrapper_;
aasdk::tcp::ITCPWrapper& tcpWrapper_;
boost::asio::io_service::strand strand_;
projection::IAndroidAutoEntityFactory& androidAutoEntityFactory_;
service::IAndroidAutoEntityFactory& androidAutoEntityFactory_;
aasdk::usb::IUSBHub::Pointer usbHub_;
aasdk::usb::IConnectedAccessoriesEnumerator::Pointer connectedAccessoriesEnumerator_;
projection::IAndroidAutoEntity::Pointer androidAutoEntity_;
service::IAndroidAutoEntity::Pointer androidAutoEntity_;
bool isStopped_;
};

Expand Down
37 changes: 0 additions & 37 deletions include/f1x/openauto/autoapp/Projection/ServiceFinishPromise.hpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,17 @@
#include <f1x/aasdk/Channel/Control/IControlServiceChannelEventHandler.hpp>
#include <f1x/aasdk/Channel/AV/VideoServiceChannel.hpp>
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntity.hpp>
#include <f1x/openauto/autoapp/Projection/IService.hpp>
#include <f1x/openauto/autoapp/Projection/IPinger.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntity.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>
#include <f1x/openauto/autoapp/Service/IPinger.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class AndroidAutoEntity: public IAndroidAutoEntity, public aasdk::channel::control::IControlServiceChannelEventHandler, public std::enable_shared_from_this<AndroidAutoEntity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@
#include <boost/asio.hpp>
#include <f1x/aasdk/Transport/ITransport.hpp>
#include <f1x/openauto/autoapp/Configuration/IConfiguration.hpp>
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntityFactory.hpp>
#include <f1x/openauto/autoapp/Projection/IServiceFactory.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityFactory.hpp>
#include <f1x/openauto/autoapp/Service/IServiceFactory.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class AndroidAutoEntityFactory: public IAndroidAutoEntityFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#pragma once

#include <f1x/aasdk/Channel/AV/AVInputServiceChannel.hpp>
#include <f1x/openauto/autoapp/Projection/IService.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>
#include <f1x/openauto/autoapp/Projection/IAudioInput.hpp>

namespace f1x
Expand All @@ -28,15 +28,15 @@ namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class AudioInputService: public aasdk::channel::av::IAVInputServiceChannelEventHandler, public IService, public std::enable_shared_from_this<AudioInputService>
{
public:
typedef std::shared_ptr<AudioInputService> Pointer;

AudioInputService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, IAudioInput::Pointer audioInput);
AudioInputService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, projection::IAudioInput::Pointer audioInput);

void start() override;
void stop() override;
Expand All @@ -55,7 +55,7 @@ class AudioInputService: public aasdk::channel::av::IAVInputServiceChannelEventH

boost::asio::io_service::strand strand_;
aasdk::channel::av::AVInputServiceChannel::Pointer channel_;
IAudioInput::Pointer audioInput_;
projection::IAudioInput::Pointer audioInput_;
int32_t session_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@
#include <f1x/aasdk/Channel/AV/IAudioServiceChannel.hpp>
#include <f1x/aasdk/Channel/AV/IAudioServiceChannelEventHandler.hpp>
#include <f1x/openauto/autoapp/Projection/IAudioOutput.hpp>
#include <f1x/openauto/autoapp/Projection/IService.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class AudioService: public aasdk::channel::av::IAudioServiceChannelEventHandler, public IService, public std::enable_shared_from_this<AudioService>
{
public:
typedef std::shared_ptr<AudioService> Pointer;

AudioService(boost::asio::io_service& ioService, aasdk::channel::av::IAudioServiceChannel::Pointer channel, IAudioOutput::Pointer audioOutput);
AudioService(boost::asio::io_service& ioService, aasdk::channel::av::IAudioServiceChannel::Pointer channel, projection::IAudioOutput::Pointer audioOutput);

void start() override;
void stop() override;
Expand All @@ -55,7 +55,7 @@ class AudioService: public aasdk::channel::av::IAudioServiceChannelEventHandler,

boost::asio::io_service::strand strand_;
aasdk::channel::av::IAudioServiceChannel::Pointer channel_;
IAudioOutput::Pointer audioOutput_;
projection::IAudioOutput::Pointer audioOutput_;
int32_t session_;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@

#include <f1x/aasdk/Channel/Bluetooth/BluetoothServiceChannel.hpp>
#include <f1x/openauto/autoapp/Projection/IBluetoothDevice.hpp>
#include <f1x/openauto/autoapp/Projection/IService.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class BluetoothService: public aasdk::channel::bluetooth::IBluetoothServiceChannelEventHandler, public IService, public std::enable_shared_from_this<BluetoothService>
{
public:
BluetoothService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, IBluetoothDevice::Pointer bluetoothDevice);
BluetoothService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, projection::IBluetoothDevice::Pointer bluetoothDevice);
void start() override;
void stop() override;
void fillFeatures(aasdk::proto::messages::ServiceDiscoveryResponse& response) override;
Expand All @@ -47,7 +47,7 @@ class BluetoothService: public aasdk::channel::bluetooth::IBluetoothServiceChann

boost::asio::io_service::strand strand_;
aasdk::channel::bluetooth::BluetoothServiceChannel::Pointer channel_;
IBluetoothDevice::Pointer bluetoothDevice_;
projection::IBluetoothDevice::Pointer bluetoothDevice_;
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#pragma once

#include <memory>
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntityEventHandler.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntityEventHandler.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class IAndroidAutoEntity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class IAndroidAutoEntityEventHandler
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

#include <f1x/aasdk/TCP/ITCPEndpoint.hpp>
#include <f1x/aasdk/USB/IAOAPDevice.hpp>
#include <f1x/openauto/autoapp/Projection/IAndroidAutoEntity.hpp>
#include <f1x/openauto/autoapp/Service/IAndroidAutoEntity.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class IAndroidAutoEntityFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class IPinger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class IService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
#pragma once

#include <f1x/aasdk/Messenger/IMessenger.hpp>
#include <f1x/openauto/autoapp/Projection/IService.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class IServiceFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include <aasdk_proto/ButtonCodeEnum.pb.h>
#include <f1x/aasdk/Channel/Input/InputServiceChannel.hpp>
#include <f1x/openauto/autoapp/Projection/IService.hpp>
#include <f1x/openauto/autoapp/Service/IService.hpp>
#include <f1x/openauto/autoapp/Projection/IInputDevice.hpp>
#include <f1x/openauto/autoapp/Projection/IInputDeviceEventHandler.hpp>

Expand All @@ -30,33 +30,33 @@ namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class InputService:
public aasdk::channel::input::IInputServiceChannelEventHandler,
public IService,
public IInputDeviceEventHandler,
public projection::IInputDeviceEventHandler,
public std::enable_shared_from_this<InputService>
{
public:
InputService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, IInputDevice::Pointer inputDevice);
InputService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, projection::IInputDevice::Pointer inputDevice);

void start() override;
void stop() override;
void fillFeatures(aasdk::proto::messages::ServiceDiscoveryResponse& response) override;
void onChannelOpenRequest(const aasdk::proto::messages::ChannelOpenRequest& request) override;
void onBindingRequest(const aasdk::proto::messages::BindingRequest& request) override;
void onChannelError(const aasdk::error::Error& e) override;
void onButtonEvent(const ButtonEvent& event) override;
void onTouchEvent(const TouchEvent& event) override;
void onButtonEvent(const projection::ButtonEvent& event) override;
void onTouchEvent(const projection::TouchEvent& event) override;

private:
using std::enable_shared_from_this<InputService>::shared_from_this;

boost::asio::io_service::strand strand_;
aasdk::channel::input::InputServiceChannel::Pointer channel_;
IInputDevice::Pointer inputDevice_;
projection::IInputDevice::Pointer inputDevice_;
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@
#pragma once

#include <f1x/aasdk/Messenger/IMessenger.hpp>
#include <f1x/openauto/autoapp/Projection/AudioService.hpp>
#include <f1x/openauto/autoapp/Service/AudioService.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class MediaAudioService: public AudioService
{
public:
MediaAudioService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, IAudioOutput::Pointer audioOutput);
MediaAudioService(boost::asio::io_service& ioService, aasdk::messenger::IMessenger::Pointer messenger, projection::IAudioOutput::Pointer audioOutput);
};

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@

#pragma once

#include <f1x/openauto/autoapp/Projection/IPinger.hpp>
#include <f1x/openauto/autoapp/Service/IPinger.hpp>

namespace f1x
{
namespace openauto
{
namespace autoapp
{
namespace projection
namespace service
{

class Pinger: public IPinger, public std::enable_shared_from_this<Pinger>
Expand Down
Loading

0 comments on commit 478caf0

Please sign in to comment.