Xfce Foundation Classes
Main Page  | IndexNamespace List  |  Alphabetical List  |  Class List  |  File List


Xfc::G::Value Class Reference

A GValue wrapper class. More...

#include <xfc/glib/value.hh>

Inheritance diagram for Xfc::G::Value:

Xfc::G::Boxed Xfc::Object Xfc::Trackable List of all members.

Public Member Functions

Constructors
Accessors
Methods

Detailed Description

A GValue wrapper class.

Value wraps the GValue structure which is basically a variable container that consists of a type identifier and a specific value of that type. The type identifier within a GValue structure determines the type of the associated value.

Values are used throughout the XFC API to set and get property values. You don't have to initialize a Value before using it. The constructor initializes the Value for you. Normally you would create a Value on the stack and pass a pointer or reference to it, to a constructor or method as required.


Constructor & Destructor Documentation

Xfc::G::Value::Value GType  type  )  [explicit]
 

Construct a Value to hold a value of type.

Parameters:
type The type identifier of the value.

Xfc::G::Value::Value GValue *  value  )  [explicit]
 

Construct a temporary Value to hold an existing GValue.

Parameters:
value An existing GValue structure.
Value does not take over ownership of the GValue, no copy is made and the GValue is not freed.

Xfc::G::Value::Value GValue *  value,
bool  copy
 

Construct a Value to hold an existing GValue.

Parameters:
value An existing GValue structure.
copy Set true if the Value should make a copy of value and use that, set false if it should take over ownership of the value.
Value either makes a copy of the GValue or takes over its ownership. When the Value is destroyed the GValue freed.


Member Function Documentation

template<typename ObjectType>
bool Xfc::G::Value::get Pointer< ObjectType > &  value  )  const [inline]
 

Get a G::Boxed or G::Object smart pointer value.

Parameters:
value A reference to the location that will hold the smart pointer value.
Returns:
false if a null pointer is returned.

bool Xfc::G::Value::get G::Object *&  value  )  const
 

Get an Object value.

Parameters:
value A reference to the location that will hold the G::Object value.
Returns:
false if a null pointer is returned.

bool Xfc::G::Value::get Boxed *&  value  )  const
 

Get a Boxed value.

Parameters:
value A reference to the location that will hold the G::Boxed value.
Returns:
false if a null pointer is returned.
You will need to call unref() on the boxed object when finished.

bool Xfc::G::Value::get String value  )  const
 

Get a String value.

Parameters:
value A reference to the location that will hold the String value.
Returns:
false if a null String is returned.

bool Xfc::G::Value::get gpointer &  value,
bool  wrap = false
const
 

Get a pointer value.

Parameters:
value A reference to the location that will hold the pointer value.
wrap Set true if the pointer is a G::Boxed or G::Object type and should be wrapped.
Returns:
false if a null pointer is returned.
This method gets values of type G_TYPE_BOXED, G_TYPE_OBJECT and G_TYPE_POINTER.

void Xfc::G::Value::get gdouble &  value  )  const
 

Get an double value.

Parameters:
value A reference to the location that will hold the double value.

void Xfc::G::Value::get gfloat &  value  )  const
 

Get a float value.

Parameters:
value A reference to the location that will hold the float value.

void Xfc::G::Value::get guint64 &  value  )  const
 

Get an unsigned 64-bit integer value.

Parameters:
value A reference to the location that will hold the unsigned 64-bit integer value.

void Xfc::G::Value::get gint64 &  value  )  const
 

Get a 64-bit integer value.

Parameters:
value A reference to the location that will hold the 64-bit integer value.

void Xfc::G::Value::get guint &  value  )  const
 

Get an unsigned integer value.

Parameters:
value A reference to the location that will hold the unsigned integer value.
This method gets values of type G_TYPE_UINT or G_TYPE_FLAGS.

void Xfc::G::Value::get gint &  value  )  const
 

Get an integer value.

Parameters:
value A reference to the location that will hold the integer value.
This method gets values of type G_TYPE_INT and G_TYPE_ENUM.

void Xfc::G::Value::get guchar &  value  )  const
 

Get an unsigned char value.

Parameters:
value A reference to the location that will hold the unsigned char value.

void Xfc::G::Value::get gchar &  value  )  const
 

Get a char value.

Parameters:
value A reference to the location that will hold the char value.

void Xfc::G::Value::get bool &  value  )  const
 

Get a boolean value.

Parameters:
value A reference to the location that will hold the boolean value.

template<typename ObjectType>
void Xfc::G::Value::set const Pointer< ObjectType > &  value  )  [inline]
 

Set a G::Boxed or G::Object smart pointer value.

Parameters:
value The smart pointer value to set.

void Xfc::G::Value::set const G::Object value  ) 
 

Set an object value.

Parameters:
value The G::Object value to set.

void Xfc::G::Value::set const Boxed value  ) 
 

Set a boxed value.

Parameters:
value The G::Boxed value to set.

void Xfc::G::Value::set const String value  ) 
 

Set a String value.

Parameters:
value The String value to set.

void Xfc::G::Value::set const gpointer  value,
bool  wrapped = false
 

Set a pointer value.

Parameters:
value The pointer value to set.
wrapped Set true if the pointer is a G::Boxed or G::Object type.
This method sets values of type G_TYPE_BOXED, G_TYPE_OBJECT and G_TYPE_POINTER.

void Xfc::G::Value::set gdouble  value  ) 
 

Set a double value.

Parameters:
value The double value to set.

void Xfc::G::Value::set gfloat  value  ) 
 

Set a float value.

Parameters:
value The float value to set.

void Xfc::G::Value::set guint64  value  ) 
 

Set an unsigned 64-bit integer value.

Parameters:
value The unsigned 64-bit integer value to set.

void Xfc::G::Value::set gint64  value  ) 
 

Set a 64-bit integer value.

Parameters:
value The 64-bit integer value to set.

void Xfc::G::Value::set guint  value  ) 
 

Set an unsigned integer value.

Parameters:
value The unsigned integer value to set.
This method sets values of type G_TYPE_UINT and G_TYPE_FLAGS.

void Xfc::G::Value::set gint  value  ) 
 

Set an integer value.

Parameters:
value The integer value to set.
This method sets values of type G_TYPE_INT and G_TYPE_ENUM.

void Xfc::G::Value::set guchar  value  ) 
 

Set an unsigned char value.

Parameters:
value The unsigned char value to set.

void Xfc::G::Value::set gchar  value  ) 
 

Set a char value.

Parameters:
value The char value to set.

void Xfc::G::Value::set bool  value  ) 
 

Set a boolean value.

Parameters:
value The boolean value to set.


The documentation for this class was generated from the following file: Xfce Foundation Classes
Copyright © 2004-2005 The XFC Development Team XFC 4.3