classias::weight_base Class Reference

Inheritance diagram for classias::weight_base:

classias::candidate_instance_base< attributes_tmpl, weight_tmpl, group_tmpl >

Detailed Description

Instance weight class.

This class implements the base interface to represent a weight of an instance.


Public Types

typedef double weight_type
 The type representing the weight.

Public Member Functions

 weight_base ()
 Constructs an object.
 weight_base (const weight_type &weight)
 Constructs an object initialized by the specified value.
 weight_base (const weight_base &rho)
 Constructs an object that is a copy of another object.
virtual ~weight_base ()
 Destructs the object.
weight_baseoperator= (const weight_base &rho)
 Assigns a new weight to the object.
void set_weight (weight_type weight)
 Assigns a new weight to the object.
weight_type get_weight () const
 Obtains the current weight value.

Protected Attributes

weight_type m_weight
 The instance weight.

Friends

bool operator== (const weight_base &x, const weight_base &y)
 Tests the equality of two weight objects.
bool operator!= (const weight_base &x, const weight_base &y)
 Tests the inequality of two weight objects.


Constructor & Destructor Documentation

classias::weight_base::weight_base ( const weight_type weight  )  [inline]

Constructs an object initialized by the specified value.

Parameters:
weight The weight value used to initialize the object.

classias::weight_base::weight_base ( const weight_base rho  )  [inline]

Constructs an object that is a copy of another object.

Parameters:
rho The original object used to initialize the object.


Member Function Documentation

weight_base& classias::weight_base::operator= ( const weight_base rho  )  [inline]

Assigns a new weight to the object.

Parameters:
rho The source object.
Return values:
weight_type& The reference to this object.

void classias::weight_base::set_weight ( weight_type  weight  )  [inline]

Assigns a new weight to the object.

Parameters:
weight The weight value.

weight_type classias::weight_base::get_weight (  )  const [inline]

Obtains the current weight value.

Return values:
weight_type The current value.


Friends And Related Function Documentation

bool operator== ( const weight_base x,
const weight_base y 
) [friend]

Tests the equality of two weight objects.

Parameters:
x A weight object.
y Another weight object.
Return values:
bool true if the values of two objects are identical, false otherwise.

bool operator!= ( const weight_base x,
const weight_base y 
) [friend]

Tests the inequality of two weight objects.

Parameters:
x A weight object.
y Another weight object.
Return values:
bool true if the values of two objects are not identical, false otherwise.


Copyright (c) 2002-2009 by Naoaki Okazaki
Mon Dec 28 23:41:06 2009