Fork Vasum on GitHub Official Vasum Wiki on Tizen.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vasum::ZonesManager Class Referencefinal

#include <zones-manager.hpp>

Public Member Functions

 ZonesManager (cargo::ipc::epoll::EventPoll &eventPoll, const std::string &managerConfigPath)
 
 ~ZonesManager ()
 
void stop (bool wait)
 Request stopping the manager. More...
 
void start ()
 Starts the manager. More...
 
bool isRunning ()
 If ZoneManager is running it needs the external polling loop to operate. More...
 
void createZone (const std::string &zoneId, const std::string &templateName)
 Create new zone. More...
 
void destroyZone (const std::string &zoneId)
 Destroy zone. More...
 
void focus (const std::string &zoneId)
 Focus this zone, put it to the foreground. More...
 
void restoreAll ()
 Restore all the configured zones to the saved state. More...
 
void shutdownAll ()
 Shutdown all managed zones without changing the saved state. More...
 
bool isPaused (const std::string &zoneId)
 
bool isRunning (const std::string &zoneId)
 
bool isStopped (const std::string &zoneId)
 
std::string getRunningForegroundZoneId ()
 
std::string getNextToForegroundZoneId ()
 
void setZonesDetachOnExit ()
 Set whether ZonesManager should detach zones on exit. More...
 
void disconnectedCallback (const std::string &id)
 Callback on a client (ipc/dbus) disconnect. More...
 
void handleLockQueueCall (api::MethodResultBuilder::Pointer result)
 
void handleUnlockQueueCall (api::MethodResultBuilder::Pointer result)
 
void handleGetZoneIdsCall (api::MethodResultBuilder::Pointer result)
 
void handleGetActiveZoneIdCall (api::MethodResultBuilder::Pointer result)
 
void handleGetZoneInfoCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleSetNetdevAttrsCall (const api::SetNetDevAttrsIn &data, api::MethodResultBuilder::Pointer result)
 
void handleGetNetdevAttrsCall (const api::GetNetDevAttrsIn &data, api::MethodResultBuilder::Pointer result)
 
void handleGetNetdevListCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleCreateNetdevVethCall (const api::CreateNetDevVethIn &data, api::MethodResultBuilder::Pointer result)
 
void handleCreateNetdevMacvlanCall (const api::CreateNetDevMacvlanIn &data, api::MethodResultBuilder::Pointer result)
 
void handleCreateNetdevPhysCall (const api::CreateNetDevPhysIn &data, api::MethodResultBuilder::Pointer result)
 
void handleDestroyNetdevCall (const api::DestroyNetDevIn &data, api::MethodResultBuilder::Pointer result)
 
void handleDeleteNetdevIpAddressCall (const api::DeleteNetdevIpAddressIn &data, api::MethodResultBuilder::Pointer result)
 
void handleDeclareFileCall (const api::DeclareFileIn &data, api::MethodResultBuilder::Pointer result)
 
void handleDeclareMountCall (const api::DeclareMountIn &data, api::MethodResultBuilder::Pointer result)
 
void handleDeclareLinkCall (const api::DeclareLinkIn &data, api::MethodResultBuilder::Pointer result)
 
void handleGetDeclarationsCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleRemoveDeclarationCall (const api::RemoveDeclarationIn &data, api::MethodResultBuilder::Pointer result)
 
void handleSetActiveZoneCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleCreateZoneCall (const api::CreateZoneIn &data, api::MethodResultBuilder::Pointer result)
 
void handleDestroyZoneCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleShutdownZoneCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleStartZoneCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleLockZoneCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleUnlockZoneCall (const api::ZoneId &data, api::MethodResultBuilder::Pointer result)
 
void handleGrantDeviceCall (const api::GrantDeviceIn &data, api::MethodResultBuilder::Pointer result)
 
void handleRevokeDeviceCall (const api::RevokeDeviceIn &data, api::MethodResultBuilder::Pointer result)
 
void handleCreateFileCall (const api::CreateFileIn &request, api::MethodResultBuilder::Pointer result)
 
void handleSwitchToDefaultCall (const std::string &caller, api::MethodResultBuilder::Pointer result)
 
void handleCleanUpZonesRootCall (api::MethodResultBuilder::Pointer result)
 
void switchingSequenceMonitorNotify ()
 

Private Types

typedef std::recursive_mutex Mutex
 
typedef std::unique_lock< MutexLock
 
typedef std::vector
< std::unique_ptr< Zone > > 
Zones
 

Private Member Functions

Zones::iterator findZone (const std::string &id)
 
ZonegetZone (const std::string &id)
 
Zones::iterator getRunningForegroundZoneIterator ()
 
Zones::iterator getNextToForegroundZoneIterator ()
 
void focusInternal (Zones::iterator iter)
 
void saveDynamicConfig ()
 
void updateDefaultId ()
 
void refocus ()
 
void generateNewConfig (const std::string &id, const std::string &templatePath)
 
std::string getTemplatePathForExistingZone (const std::string &id)
 
int getVTForNewZone ()
 
void insertZone (const std::string &zoneId, const std::string &templatePath)
 
void tryAddTask (const utils::Worker::Task &task, api::MethodResultBuilder::Pointer result, bool wait)
 

Private Attributes

bool mIsRunning
 
utils::Worker::Pointer mWorker
 
Mutex mMutex
 
ZonesManagerConfig mConfig
 
ZonesManagerDynamicConfig mDynamicConfig
 
std::unique_ptr< InputMonitormSwitchingSequenceMonitor
 
Zones mZones
 
std::string mActiveZoneId
 
bool mDetachOnExit
 
std::string mExclusiveIDLock
 
Mutex mExclusiveIDMutex
 
HostIPCConnection mHostIPCConnection
 

Member Typedef Documentation

typedef std::unique_lock<Mutex> vasum::ZonesManager::Lock
private
typedef std::recursive_mutex vasum::ZonesManager::Mutex
private
typedef std::vector<std::unique_ptr<Zone> > vasum::ZonesManager::Zones
private

Constructor & Destructor Documentation

vasum::ZonesManager::ZonesManager ( cargo::ipc::epoll::EventPoll eventPoll,
const std::string &  managerConfigPath 
)
vasum::ZonesManager::~ZonesManager ( )

Member Function Documentation

void vasum::ZonesManager::createZone ( const std::string &  zoneId,
const std::string &  templateName 
)

Create new zone.

Parameters
zoneIdid of new zone
templateNamea template name
void vasum::ZonesManager::destroyZone ( const std::string &  zoneId)

Destroy zone.

Parameters
zoneIdid of the zone
void vasum::ZonesManager::disconnectedCallback ( const std::string &  id)

Callback on a client (ipc/dbus) disconnect.

ZonesManager::Zones::iterator vasum::ZonesManager::findZone ( const std::string &  id)
private
void vasum::ZonesManager::focus ( const std::string &  zoneId)

Focus this zone, put it to the foreground.

Method blocks until the focus is switched.

Parameters
zoneIdid of the zone
void vasum::ZonesManager::focusInternal ( Zones::iterator  iter)
private
void vasum::ZonesManager::generateNewConfig ( const std::string &  id,
const std::string &  templatePath 
)
private
std::string vasum::ZonesManager::getNextToForegroundZoneId ( )
Returns
id of next to currently focused/foreground zone. If currently focused zone is last in zone map, id of fisrt zone from map is returned.
ZonesManager::Zones::iterator vasum::ZonesManager::getNextToForegroundZoneIterator ( )
private
std::string vasum::ZonesManager::getRunningForegroundZoneId ( )
Returns
id of the currently focused/foreground zone
ZonesManager::Zones::iterator vasum::ZonesManager::getRunningForegroundZoneIterator ( )
private
std::string vasum::ZonesManager::getTemplatePathForExistingZone ( const std::string &  id)
private
int vasum::ZonesManager::getVTForNewZone ( )
private
Zone & vasum::ZonesManager::getZone ( const std::string &  id)
private
void vasum::ZonesManager::handleCleanUpZonesRootCall ( api::MethodResultBuilder::Pointer  result)
void vasum::ZonesManager::handleCreateFileCall ( const api::CreateFileIn request,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleCreateNetdevMacvlanCall ( const api::CreateNetDevMacvlanIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleCreateNetdevPhysCall ( const api::CreateNetDevPhysIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleCreateNetdevVethCall ( const api::CreateNetDevVethIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleCreateZoneCall ( const api::CreateZoneIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleDeclareFileCall ( const api::DeclareFileIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleDeclareLinkCall ( const api::DeclareLinkIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleDeclareMountCall ( const api::DeclareMountIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleDeleteNetdevIpAddressCall ( const api::DeleteNetdevIpAddressIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleDestroyNetdevCall ( const api::DestroyNetDevIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleDestroyZoneCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleGetActiveZoneIdCall ( api::MethodResultBuilder::Pointer  result)
void vasum::ZonesManager::handleGetDeclarationsCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleGetNetdevAttrsCall ( const api::GetNetDevAttrsIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleGetNetdevListCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleGetZoneIdsCall ( api::MethodResultBuilder::Pointer  result)
void vasum::ZonesManager::handleGetZoneInfoCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleGrantDeviceCall ( const api::GrantDeviceIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleLockQueueCall ( api::MethodResultBuilder::Pointer  result)
void vasum::ZonesManager::handleLockZoneCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleRemoveDeclarationCall ( const api::RemoveDeclarationIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleRevokeDeviceCall ( const api::RevokeDeviceIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleSetActiveZoneCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleSetNetdevAttrsCall ( const api::SetNetDevAttrsIn data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleShutdownZoneCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleStartZoneCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleSwitchToDefaultCall ( const std::string &  caller,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::handleUnlockQueueCall ( api::MethodResultBuilder::Pointer  result)
void vasum::ZonesManager::handleUnlockZoneCall ( const api::ZoneId data,
api::MethodResultBuilder::Pointer  result 
)
void vasum::ZonesManager::insertZone ( const std::string &  zoneId,
const std::string &  templatePath 
)
private
bool vasum::ZonesManager::isPaused ( const std::string &  zoneId)
Returns
Is the zone in a paused state?
bool vasum::ZonesManager::isRunning ( )

If ZoneManager is running it needs the external polling loop to operate.

Returns
is manager still running
bool vasum::ZonesManager::isRunning ( const std::string &  zoneId)
Returns
Is the zone running?
bool vasum::ZonesManager::isStopped ( const std::string &  zoneId)
Returns
Is the zone stopped?
void vasum::ZonesManager::refocus ( )
private
void vasum::ZonesManager::restoreAll ( )

Restore all the configured zones to the saved state.

void vasum::ZonesManager::saveDynamicConfig ( )
private
void vasum::ZonesManager::setZonesDetachOnExit ( )

Set whether ZonesManager should detach zones on exit.

void vasum::ZonesManager::shutdownAll ( )

Shutdown all managed zones without changing the saved state.

void vasum::ZonesManager::start ( )

Starts the manager.

void vasum::ZonesManager::stop ( bool  wait)

Request stopping the manager.

Parameters
waitdoes it block waiting for all internals to stop
void vasum::ZonesManager::switchingSequenceMonitorNotify ( )
void vasum::ZonesManager::tryAddTask ( const utils::Worker::Task task,
api::MethodResultBuilder::Pointer  result,
bool  wait 
)
private
void vasum::ZonesManager::updateDefaultId ( )
private

Member Data Documentation

std::string vasum::ZonesManager::mActiveZoneId
private
ZonesManagerConfig vasum::ZonesManager::mConfig
private
bool vasum::ZonesManager::mDetachOnExit
private
ZonesManagerDynamicConfig vasum::ZonesManager::mDynamicConfig
private
std::string vasum::ZonesManager::mExclusiveIDLock
private
Mutex vasum::ZonesManager::mExclusiveIDMutex
private
HostIPCConnection vasum::ZonesManager::mHostIPCConnection
private
bool vasum::ZonesManager::mIsRunning
private
Mutex vasum::ZonesManager::mMutex
private
std::unique_ptr<InputMonitor> vasum::ZonesManager::mSwitchingSequenceMonitor
private
utils::Worker::Pointer vasum::ZonesManager::mWorker
private
Zones vasum::ZonesManager::mZones
private

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