libzypp  17.10.1
zypp::target::hal::HalContext Class Reference

}@ More...

#include <HalContext.h>

Public Types

typedef zypp::RW_pointer< HalContext_Impl >::unspecified_bool_type bool_type
 

Public Member Functions

 HalContext (bool autoconnect=false)
 
 HalContext (const HalContext &context)
 
 ~HalContext ()
 
HalContextoperator= (const HalContext &context)
 
 operator bool_type () const
 Verifies if the context is initialized. More...
 
void connect ()
 
std::vector< std::string > getAllDevices () const
 Retrieve UDI's of all devices. More...
 
HalDrive getDriveFromUDI (const std::string &udi) const
 Construct a HalDrive object for the specified UDI. More...
 
HalVolume getVolumeFromUDI (const std::string &udi) const
 Construct a HalVolume object for the specified UDI. More...
 
HalVolume getVolumeFromDeviceFile (const std::string &device_file) const
 
std::vector< std::string > findDevicesByCapability (const std::string &capability) const
 Retrieve UDI's of all devices with a capability. More...
 
bool getDevicePropertyBool (const std::string &udi, const std::string &key) const
 
int32_t getDevicePropertyInt32 (const std::string &udi, const std::string &key) const
 
uint64_t getDevicePropertyUInt64 (const std::string &udi, const std::string &key) const
 
double getDevicePropertyDouble (const std::string &udi, const std::string &key) const
 
std::string getDevicePropertyString (const std::string &udi, const std::string &key) const
 
void setDevicePropertyBool (const std::string &udi, const std::string &key, bool value)
 
void setDevicePropertyInt32 (const std::string &udi, const std::string &key, int32_t value)
 
void setDevicePropertyUInt64 (const std::string &udi, const std::string &key, uint64_t value)
 
void setDevicePropertyDouble (const std::string &udi, const std::string &key, double value)
 
void setDevicePropertyString (const std::string &udi, const std::string &key, const std::string &value)
 
void removeDeviceProperty (const std::string &udi, const std::string &key)
 

Private Attributes

zypp::RW_pointer< HalContext_Implh_impl
 

Detailed Description

}@

Hardware abstaction layer context.

Hal context wrapper. It manages the dbus connection and is the entry point to query drives, volumes and other information.

Todo:
: wrap more functions.

Definition at line 57 of file HalContext.h.

Member Typedef Documentation

◆ bool_type

Definition at line 61 of file HalContext.h.

Constructor & Destructor Documentation

◆ HalContext() [1/2]

zypp::target::hal::HalContext::HalContext ( bool  autoconnect = false)

Definition at line 310 of file HalContext.cc.

◆ HalContext() [2/2]

zypp::target::hal::HalContext::HalContext ( const HalContext context)

Definition at line 320 of file HalContext.cc.

◆ ~HalContext()

zypp::target::hal::HalContext::~HalContext ( )

Definition at line 329 of file HalContext.cc.

Member Function Documentation

◆ operator=()

HalContext & zypp::target::hal::HalContext::operator= ( const HalContext context)

Definition at line 338 of file HalContext.cc.

◆ operator bool_type()

zypp::target::hal::HalContext::operator HalContext::bool_type ( ) const

Verifies if the context is initialized.

Definition at line 350 of file HalContext.cc.

◆ connect()

void zypp::target::hal::HalContext::connect ( )

Definition at line 359 of file HalContext.cc.

◆ getAllDevices()

std::vector< std::string > zypp::target::hal::HalContext::getAllDevices ( ) const

Retrieve UDI's of all devices.

Returns
Vector with device UDI's.

Definition at line 369 of file HalContext.cc.

◆ getDriveFromUDI()

HalDrive zypp::target::hal::HalContext::getDriveFromUDI ( const std::string &  udi) const

Construct a HalDrive object for the specified UDI.

Parameters
Theudi of the drive.
Returns
The HalDrive object.

Definition at line 391 of file HalContext.cc.

◆ getVolumeFromUDI()

HalVolume zypp::target::hal::HalContext::getVolumeFromUDI ( const std::string &  udi) const

Construct a HalVolume object for the specified UDI.

Parameters
Theudi of the volume.
Returns
The HalVolume object.

Definition at line 405 of file HalContext.cc.

◆ getVolumeFromDeviceFile()

HalVolume zypp::target::hal::HalContext::getVolumeFromDeviceFile ( const std::string &  device_file) const

Definition at line 419 of file HalContext.cc.

◆ findDevicesByCapability()

std::vector< std::string > zypp::target::hal::HalContext::findDevicesByCapability ( const std::string &  capability) const

Retrieve UDI's of all devices with a capability.

Parameters
Thecapability name
Returns
Vector with device UDI's.

Definition at line 434 of file HalContext.cc.

◆ getDevicePropertyBool()

bool zypp::target::hal::HalContext::getDevicePropertyBool ( const std::string &  udi,
const std::string &  key 
) const

Definition at line 458 of file HalContext.cc.

◆ getDevicePropertyInt32()

int32_t zypp::target::hal::HalContext::getDevicePropertyInt32 ( const std::string &  udi,
const std::string &  key 
) const

Definition at line 480 of file HalContext.cc.

◆ getDevicePropertyUInt64()

uint64_t zypp::target::hal::HalContext::getDevicePropertyUInt64 ( const std::string &  udi,
const std::string &  key 
) const

Definition at line 502 of file HalContext.cc.

◆ getDevicePropertyDouble()

double zypp::target::hal::HalContext::getDevicePropertyDouble ( const std::string &  udi,
const std::string &  key 
) const

Definition at line 524 of file HalContext.cc.

◆ getDevicePropertyString()

std::string zypp::target::hal::HalContext::getDevicePropertyString ( const std::string &  udi,
const std::string &  key 
) const

Definition at line 547 of file HalContext.cc.

◆ setDevicePropertyBool()

void zypp::target::hal::HalContext::setDevicePropertyBool ( const std::string &  udi,
const std::string &  key,
bool  value 
)

Definition at line 575 of file HalContext.cc.

◆ setDevicePropertyInt32()

void zypp::target::hal::HalContext::setDevicePropertyInt32 ( const std::string &  udi,
const std::string &  key,
int32_t  value 
)

Definition at line 598 of file HalContext.cc.

◆ setDevicePropertyUInt64()

void zypp::target::hal::HalContext::setDevicePropertyUInt64 ( const std::string &  udi,
const std::string &  key,
uint64_t  value 
)

Definition at line 621 of file HalContext.cc.

◆ setDevicePropertyDouble()

void zypp::target::hal::HalContext::setDevicePropertyDouble ( const std::string &  udi,
const std::string &  key,
double  value 
)

Definition at line 644 of file HalContext.cc.

◆ setDevicePropertyString()

void zypp::target::hal::HalContext::setDevicePropertyString ( const std::string &  udi,
const std::string &  key,
const std::string &  value 
)

Definition at line 667 of file HalContext.cc.

◆ removeDeviceProperty()

void zypp::target::hal::HalContext::removeDeviceProperty ( const std::string &  udi,
const std::string &  key 
)

Definition at line 690 of file HalContext.cc.

Member Data Documentation

◆ h_impl

zypp::RW_pointer<HalContext_Impl> zypp::target::hal::HalContext::h_impl
private

Definition at line 165 of file HalContext.h.


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