WMI Library
Public Member Functions | Static Public Attributes | Private Types | Private Attributes
WMI::Connection Class Reference

A connection to the WMI provider on a host. More...

#include <Connection.hpp>

List of all members.

Public Member Functions

 Connection ()
 Default constructor.
 ~Connection ()
 Destructor.
bool isOpen () const
 Query if the connection is open.
void open ()
 Open a connection to the current host.
void open (const tstring &host, const tstring &login, const tstring &password)
 Open a connection to a specific host.
void open (const tstring &host, const tstring &login, const tstring &password, const tstring &nmspace)
 Open a connection to a specific host and namespace.
void close ()
 Close the connection.
ObjectIterator execQuery (const tchar *query)
 Execute the query.

Static Public Attributes

static const tstring LOCALHOST = TXT(".")
 The local computer path.
static const tstring DEFAULT_NAMESPACE = TXT("\\root\\cimv2")
 The default namespace.

Private Types

typedef WCL::ComPtr< IWbemLocator > IWbemLocatorPtr
 The WMI Locator COM interface.
typedef WCL::ComPtr
< IWbemServices > 
IWbemServicesPtr
 The WMI Conection COM interface.
typedef WCL::ComPtr
< IEnumWbemClassObject > 
IEnumWbemClassObjectPtr
 The WMI query result type.

Private Attributes

IWbemLocatorPtr m_locator
 The underlyng WMI locator.
IWbemServicesPtr m_services
 The underlying WMI connection.

Detailed Description

A connection to the WMI provider on a host.


Member Typedef Documentation

typedef WCL::ComPtr<IWbemLocator> WMI::Connection::IWbemLocatorPtr [private]

The WMI Locator COM interface.

typedef WCL::ComPtr<IWbemServices> WMI::Connection::IWbemServicesPtr [private]

The WMI Conection COM interface.

typedef WCL::ComPtr<IEnumWbemClassObject> WMI::Connection::IEnumWbemClassObjectPtr [private]

The WMI query result type.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

bool WMI::Connection::isOpen ( ) const

Query if the connection is open.

Open a connection to the current host.

void WMI::Connection::open ( const tstring &  host,
const tstring &  login,
const tstring &  password 
)

Open a connection to a specific host.

void WMI::Connection::open ( const tstring &  host,
const tstring &  login,
const tstring &  password,
const tstring &  nmspace 
)

Open a connection to a specific host and namespace.

Close the connection.

ObjectIterator WMI::Connection::execQuery ( const tchar *  query)

Execute the query.


Member Data Documentation

const tstring WMI::Connection::LOCALHOST = TXT(".") [static]

The local computer path.

const tstring WMI::Connection::DEFAULT_NAMESPACE = TXT("\\root\\cimv2") [static]

The default namespace.

The underlyng WMI locator.

The underlying WMI connection.


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