OpenDDS::DCPS::StructComparator< Sample, Field > Class Template Reference

#include <Comparator_T.h>

Inheritance diagram for OpenDDS::DCPS::StructComparator< Sample, Field >:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::StructComparator< Sample, Field >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef Field Sample::* MemberPtr

Public Member Functions

 StructComparator (MemberPtr mp, ComparatorBase::Ptr delegate, ComparatorBase::Ptr next)
bool less (void *lhs_void, void *rhs_void) const
bool equal (void *lhs_void, void *rhs_void) const

Private Attributes

MemberPtr mp_
ComparatorBase::Ptr delegate_

Detailed Description

template<class Sample, class Field>
class OpenDDS::DCPS::StructComparator< Sample, Field >

deal with nested structs, for example: struct A { long x; }; struct B { A theA; }; B's query string has "ORDER BY theA.x" The generated code will create a StructComparator with Sample = B and Field = A which in turn has a "delegate" which is a FieldComparator (see above) with Sample = A and Field = CORBA::Long

Definition at line 91 of file Comparator_T.h.


Member Typedef Documentation

template<class Sample, class Field>
typedef Field Sample::* OpenDDS::DCPS::StructComparator< Sample, Field >::MemberPtr

Definition at line 93 of file Comparator_T.h.


Constructor & Destructor Documentation

template<class Sample, class Field>
OpenDDS::DCPS::StructComparator< Sample, Field >::StructComparator ( MemberPtr  mp,
ComparatorBase::Ptr  delegate,
ComparatorBase::Ptr  next 
) [inline]

Definition at line 94 of file Comparator_T.h.

00096   : ComparatorBase(next)
00097   , mp_(mp)
00098   , delegate_(delegate) {}


Member Function Documentation

template<class Sample, class Field>
bool OpenDDS::DCPS::StructComparator< Sample, Field >::equal ( void *  lhs_void,
void *  rhs_void 
) const [inline, virtual]

Implements OpenDDS::DCPS::ComparatorBase.

Definition at line 106 of file Comparator_T.h.

References OpenDDS::DCPS::StructComparator< Sample, Field >::delegate_, and OpenDDS::DCPS::StructComparator< Sample, Field >::mp_.

00106                                                    {
00107     Sample* lhs = static_cast<Sample*>(lhs_void);
00108     Sample* rhs = static_cast<Sample*>(rhs_void);
00109     return delegate_->equal(&(lhs->*mp_), &(rhs->*mp_));
00110   }

template<class Sample, class Field>
bool OpenDDS::DCPS::StructComparator< Sample, Field >::less ( void *  lhs_void,
void *  rhs_void 
) const [inline, virtual]

Implements OpenDDS::DCPS::ComparatorBase.

Definition at line 100 of file Comparator_T.h.

References OpenDDS::DCPS::StructComparator< Sample, Field >::delegate_, and OpenDDS::DCPS::StructComparator< Sample, Field >::mp_.

00100                                                   {
00101     Sample* lhs = static_cast<Sample*>(lhs_void);
00102     Sample* rhs = static_cast<Sample*>(rhs_void);
00103     return delegate_->less(&(lhs->*mp_), &(rhs->*mp_));
00104   }


Member Data Documentation

template<class Sample, class Field>
ComparatorBase::Ptr OpenDDS::DCPS::StructComparator< Sample, Field >::delegate_ [private]

Definition at line 114 of file Comparator_T.h.

Referenced by OpenDDS::DCPS::StructComparator< Sample, Field >::equal(), and OpenDDS::DCPS::StructComparator< Sample, Field >::less().

template<class Sample, class Field>
MemberPtr OpenDDS::DCPS::StructComparator< Sample, Field >::mp_ [private]

Definition at line 113 of file Comparator_T.h.

Referenced by OpenDDS::DCPS::StructComparator< Sample, Field >::equal(), and OpenDDS::DCPS::StructComparator< Sample, Field >::less().


The documentation for this class was generated from the following file:
Generated on Fri Feb 12 20:06:11 2016 for OpenDDS by  doxygen 1.4.7