All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::da::OrderByItem Class Reference

A class that can be used in an ORDER BY clause to sort the items of a resulting query. More...

#include <OrderByItem.h>

Public Member Functions

ExpressiongetExpression () const
 It returns the exprsssion to be used to sort the result of a query. More...
 
SortOrder getSortOrder () const
 It returns the order of sorting: Asc or Desc. More...
 
OrderByItemoperator= (const OrderByItem &rhs)
 
 OrderByItem (const Expression &e, SortOrder order=ASC)
 Constructor. More...
 
 OrderByItem (Expression *e, SortOrder order=ASC)
 Constructor. More...
 
 OrderByItem (const std::string &propertyName, SortOrder order=ASC)
 Constructor. More...
 
 OrderByItem (const OrderByItem &rhs)
 Copy constructor. More...
 
void setExpression (Expression *e)
 It sets the expression to sort the result of a query. More...
 
void setSortOrder (SortOrder o)
 It sets the order to be used during the sorting of a query. More...
 
 ~OrderByItem ()
 Destructor. More...
 

Private Attributes

std::auto_ptr< Expressionm_field
 A valid expression. More...
 
SortOrder m_order
 Sort order. More...
 

Detailed Description

A class that can be used in an ORDER BY clause to sort the items of a resulting query.

The order default will be ascendent if none is informed.

See also
OrderBy

Definition at line 53 of file OrderByItem.h.

Constructor & Destructor Documentation

te::da::OrderByItem::OrderByItem ( const Expression e,
SortOrder  order = ASC 
)
explicit

Constructor.

Parameters
eAn expression to be used in an ORDER BY clause.
orderThe sort order.

Definition at line 31 of file OrderByItem.cpp.

te::da::OrderByItem::OrderByItem ( Expression e,
SortOrder  order = ASC 
)
explicit

Constructor.

Parameters
eAn expression to be used in an ORDER BY clause.
orderThe sort order.
Note
The OrderByItem will take the ownership of Expression.

Definition at line 37 of file OrderByItem.cpp.

te::da::OrderByItem::OrderByItem ( const std::string &  propertyName,
SortOrder  order = ASC 
)
explicit

Constructor.

Parameters
propertyNameA property name.
orderThe sort order.

Definition at line 43 of file OrderByItem.cpp.

te::da::OrderByItem::OrderByItem ( const OrderByItem rhs)
explicit

Copy constructor.

Definition at line 49 of file OrderByItem.cpp.

References m_field.

te::da::OrderByItem::~OrderByItem ( )

Destructor.

Definition at line 56 of file OrderByItem.cpp.

Member Function Documentation

te::da::Expression * te::da::OrderByItem::getExpression ( ) const

It returns the exprsssion to be used to sort the result of a query.

Returns
The exprsssion to be used to sort the result of a query.

Definition at line 76 of file OrderByItem.cpp.

Referenced by te::serialize::xml::Save().

te::da::SortOrder te::da::OrderByItem::getSortOrder ( ) const

It returns the order of sorting: Asc or Desc.

Returns
The order of sorting: Asc or Desc.

Definition at line 86 of file OrderByItem.cpp.

Referenced by te::serialize::xml::Save().

te::da::OrderByItem & te::da::OrderByItem::operator= ( const OrderByItem rhs)

Assignment operator.

Definition at line 60 of file OrderByItem.cpp.

References m_field, and m_order.

void te::da::OrderByItem::setExpression ( Expression e)

It sets the expression to sort the result of a query.

Parameters
eThe expression to be used to sort the result of a query.
Note
The OrderByItem will take the expression ownership.

Definition at line 71 of file OrderByItem.cpp.

void te::da::OrderByItem::setSortOrder ( SortOrder  o)

It sets the order to be used during the sorting of a query.

Parameters
oThe order to be used during the sorting of a query.

Definition at line 81 of file OrderByItem.cpp.

Member Data Documentation

std::auto_ptr<Expression> te::da::OrderByItem::m_field
private

A valid expression.

Definition at line 124 of file OrderByItem.h.

Referenced by operator=(), and OrderByItem().

SortOrder te::da::OrderByItem::m_order
private

Sort order.

Definition at line 125 of file OrderByItem.h.

Referenced by operator=().


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