Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
JGIZMO::JLineAttributes Class Reference

Auxiliary class to set line attributes. More...

#include <JLineAttributes.hh>

Inheritance diagram for JGIZMO::JLineAttributes:
JLANG::JRewindableObjectIterator< T > std::vector< TAttLine > JLANG::JObjectIterator< T > JLANG::JRewindable< T >

Public Types

typedef
JRewindableObjectIterator
< TAttLine >::pointer_type 
pointer_type
 

Public Member Functions

 JLineAttributes (const Width_t width=2)
 Constructor. More...
 
void setLineWidth (const Width_t width)
 Set line width. More...
 
virtual void rewind ()
 Rewind index. More...
 
virtual bool hasNext ()
 Check availability of next element. More...
 
virtual const pointer_typenext ()
 Get next element. More...
 
const TAttLine & get (unsigned int index)
 Get line attributes. More...
 
virtual skip_type skip (const skip_type ns)
 Skip items. More...
 

Static Public Member Functions

static JLineAttributesgetInstance ()
 Get reference to unique instance of this class object. More...
 

Private Attributes

unsigned int index
 

Detailed Description

Auxiliary class to set line attributes.

Definition at line 27 of file JLineAttributes.hh.

Member Typedef Documentation

Definition at line 33 of file JLineAttributes.hh.

Constructor & Destructor Documentation

JGIZMO::JLineAttributes::JLineAttributes ( const Width_t  width = 2)
inline

Constructor.

Parameters
widthline width

Definition at line 41 of file JLineAttributes.hh.

41  :
43  index(0)
44  {
45  for (int i = 1; i <= 10; ++i) {
46  push_back(TAttLine(kBlack, i, width));
47  }
48  }

Member Function Documentation

static JLineAttributes& JGIZMO::JLineAttributes::getInstance ( )
inlinestatic

Get reference to unique instance of this class object.

Returns
reference to this class object

Definition at line 56 of file JLineAttributes.hh.

57  {
58  static JLineAttributes line(2);
59 
60  return line;
61  }
Auxiliary class to set line attributes.
void JGIZMO::JLineAttributes::setLineWidth ( const Width_t  width)
inline

Set line width.

Parameters
widthline width

Definition at line 69 of file JLineAttributes.hh.

70  {
71  for (iterator i = this->begin(); i != this->end(); ++i) {
72  i->SetLineWidth(width);
73  }
74  }
virtual void JGIZMO::JLineAttributes::rewind ( )
inlinevirtual

Rewind index.

Implements JLANG::JRewindable< T >.

Definition at line 80 of file JLineAttributes.hh.

81  {
82  index = 0;
83  }
virtual bool JGIZMO::JLineAttributes::hasNext ( )
inlinevirtual

Check availability of next element.

Returns
true if the iteration has more elements; else false

Implements JLANG::JObjectIterator< T >.

Definition at line 91 of file JLineAttributes.hh.

92  {
93  return !this->empty();
94  }
virtual const pointer_type& JGIZMO::JLineAttributes::next ( )
inlinevirtual

Get next element.

Returns
pointer to element

Implements JLANG::JObjectIterator< T >.

Definition at line 102 of file JLineAttributes.hh.

103  {
104  static pointer_type ps;
105 
106  if (index < this->size()) {
107  ps.reset(&this->at(index));
108  }
109 
110  ++index;
111 
112  index = index%this->size();
113 
114  return ps;
115  }
JRewindableObjectIterator< TAttLine >::pointer_type pointer_type
const TAttLine& JGIZMO::JLineAttributes::get ( unsigned int  index)
inline

Get line attributes.

Parameters
indexindex
Returns
line attributes

Definition at line 124 of file JLineAttributes.hh.

125  {
126  return this->at(index%this->size());
127  }
template<class T>
virtual skip_type JLANG::JObjectIterator< T >::skip ( const skip_type  ns)
inlinevirtualinherited

Skip items.

Parameters
nsnumber of items to skip
Returns
number of items skipped

Reimplemented in JLANG::JPipe< T >, JLANG::JPipe< JTail_t >, JLANG::JPipe< JHead_t >, JLANG::JSTDObjectIterator< T >, JLANG::JAbstractObjectReader< T >, JLANG::JAbstractObjectReader< JNullType >, JLANG::JAbstractObjectReader< const T >, JLANG::JAbstractObjectReader< JTail_t >, JLANG::JAbstractObjectReader< JHead_t >, JLANG::JAbstractObjectReader< KM3NETDAQ::KM3NETDAQ::JDAQEvent >, JLANG::JAbstractObjectReader< JDAQSummaryslice >, and JLANG::JAbstractObjectReader< JTypeList< JDAQEvent, JTypelist_t > >.

Definition at line 88 of file JObjectIterator.hh.

89  {
90  skip_type i = 0;
91 
92  for ( ; i != ns && hasNext(); ++i) {
93  next();
94  }
95 
96  return i;
97  }
unsigned int skip_type
Type definition for number of objects to skip.
virtual const pointer_type & next()=0
Get next element.
virtual bool hasNext()=0
Check availability of next element.

Member Data Documentation

unsigned int JGIZMO::JLineAttributes::index
private

Definition at line 131 of file JLineAttributes.hh.


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