Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
host-ipc-connection.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Contact: Mateusz Malicki <m.malicki2@samsung.com>
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License
17  */
18 
26 #ifndef SERVER_HOST_IPC_CONNECTION_HPP
27 #define SERVER_HOST_IPC_CONNECTION_HPP
28 
29 #include "api/messages.hpp"
31 #include "cargo-ipc/service.hpp"
32 #include "ipc-callback-wrapper.hpp"
33 
34 namespace vasum {
35 
36 class ZonesManager;
37 
39 public:
40  template<typename ArgIn = const api::Void, typename ArgOut = api::Void>
41  class Method {
42  public:
44  };
45  template<typename ArgIn>
46  class Signal {
47  public:
49  };
50 
53 
54  void start();
55  void stop(bool wait);
56  void signalZoneConnectionState(const api::ConnectionState& connectionState);
57  bool isRunning();
58 
59 private:
60  void setLockQueueCallback(const Method<api::Void>::type& callback);
61  void setUnlockQueueCallback(const Method<api::Void>::type& callback);
91 
92  std::unique_ptr<cargo::ipc::Service> mService;
94 };
95 
96 } // namespace vasum
97 
98 #endif // SERVER_HOST_IPC_CONNECTION_HPP
C++ epoll wrapper.
void setGetZoneConnectionsCallback(const Method< api::Connections >::type &callback)
void setDeclareLinkCallback(const Method< const api::DeclareLinkIn, api::Declaration >::type &callback)
Definition: host-ipc-connection.cpp:285
void setStartZoneCallback(const Method< const api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:341
void setUnlockQueueCallback(const Method< api::Void >::type &callback)
Definition: host-ipc-connection.cpp:173
Declaration of the cargo IPC handling class.
void setCleanUpZonesRootCallback(const Method< api::Void >::type &callback)
Definition: host-ipc-connection.cpp:398
IPCSignalWrapper and IPCMethodWrapper classes used to hide IPC specifics.
ZonesManager * mZonesManagerPtr
Definition: host-ipc-connection.hpp:93
Definition: host-ipc-connection.hpp:41
HostIPCConnection(cargo::ipc::epoll::EventPoll &eventPoll, ZonesManager *zm)
Definition: host-ipc-connection.cpp:38
void setDestroyZoneCallback(const Method< const api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:325
void setCreateNetdevPhysCallback(const Method< const api::CreateNetDevPhysIn >::type &callback)
Definition: host-ipc-connection.cpp:245
void setDestroyNetdevCallback(const Method< const api::DestroyNetDevIn >::type &callback)
Definition: host-ipc-connection.cpp:253
void start()
Definition: host-ipc-connection.cpp:147
void setCreateNetdevMacvlanCallback(const Method< const api::CreateNetDevMacvlanIn >::type &callback)
Definition: host-ipc-connection.cpp:237
std::unique_ptr< cargo::ipc::Service > mService
Definition: host-ipc-connection.hpp:92
void setShutdownZoneCallback(const Method< const api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:333
std::function< void(const in &)> type
Definition: ipc-callback-wrapper.hpp:41
void setGetZoneInfoCallback(const Method< const api::ZoneId, api::ZoneInfoOut >::type &callback)
Definition: host-ipc-connection.cpp:197
bool isRunning()
Definition: host-ipc-connection.cpp:160
void setDeleteNetdevIpAddressCallback(const Method< const api::DeleteNetdevIpAddressIn >::type &callback)
Definition: host-ipc-connection.cpp:261
IPCMethodWrapper< ArgIn, ArgOut >::type type
Definition: host-ipc-connection.hpp:43
void setLockQueueCallback(const Method< api::Void >::type &callback)
Definition: host-ipc-connection.cpp:165
Definition: zones-manager.hpp:51
void setCreateZoneCallback(const Method< const api::CreateZoneIn >::type &callback)
Definition: host-ipc-connection.cpp:317
void setLockZoneCallback(const Method< const api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:349
void setCreateNetdevVethCallback(const Method< const api::CreateNetDevVethIn >::type &callback)
Definition: host-ipc-connection.cpp:229
void setGetZoneIdsCallback(const Method< api::ZoneIds >::type &callback)
Definition: host-ipc-connection.cpp:181
void setDeclareFileCallback(const Method< const api::DeclareFileIn, api::Declaration >::type &callback)
Definition: host-ipc-connection.cpp:269
Definition: messages.hpp:49
void setSwitchToDefaultCallback(const Method< api::Void >::type &callback)
Definition: host-ipc-connection.cpp:381
void setGetDeclarationsCallback(const Method< const api::ZoneId, api::Declarations >::type &callback)
Definition: host-ipc-connection.cpp:293
void setDeclareMountCallback(const Method< const api::DeclareMountIn, api::Declaration >::type &callback)
Definition: host-ipc-connection.cpp:277
void setSetActiveZoneCallback(const Method< const api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:309
void setGetActiveZoneIdCallback(const Method< api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:189
~HostIPCConnection()
Definition: host-ipc-connection.cpp:143
void signalZoneConnectionState(const api::ConnectionState &connectionState)
std::function< void(const in &, api::MethodResultBuilder::Pointer)> type
Definition: ipc-callback-wrapper.hpp:74
void setRevokeDeviceCallback(const Method< const api::RevokeDeviceIn >::type &callback)
Definition: host-ipc-connection.cpp:373
void setCreateFileCallback(const Method< const api::CreateFileIn, api::CreateFileOut >::type &callback)
Definition: host-ipc-connection.cpp:389
IPCSignalWrapper< ArgIn >::type type
Definition: host-ipc-connection.hpp:48
void setUnlockZoneCallback(const Method< const api::ZoneId >::type &callback)
Definition: host-ipc-connection.cpp:357
void stop(bool wait)
Definition: host-ipc-connection.cpp:154
void setGetNetdevListCallback(const Method< const api::ZoneId, api::NetDevList >::type &callback)
Definition: host-ipc-connection.cpp:221
This class waits on registered file descriptor for events.
Definition: event-poll.hpp:47
void setGetNetdevAttrsCallback(const Method< const api::GetNetDevAttrsIn, api::GetNetDevAttrs >::type &callback)
Definition: host-ipc-connection.cpp:213
void setSetNetdevAttrsCallback(const Method< const api::SetNetDevAttrsIn >::type &callback)
Definition: host-ipc-connection.cpp:205
void setGrantDeviceCallback(const Method< const api::GrantDeviceIn >::type &callback)
Definition: host-ipc-connection.cpp:365
Definition: host-ipc-connection.hpp:46
void setRemoveDeclarationCallback(const Method< const api::RemoveDeclarationIn >::type &callback)
Definition: host-ipc-connection.cpp:301
Definition: host-ipc-connection.hpp:38
Host's internal IPC messages declaration.