Jpp  17.3.1
the software that should make you happy
 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
JROOT::JLineAttributes Class Reference

Auxiliary class to set line attributes. More...

#include <JLineAttributes.hh>

Inheritance diagram for JROOT::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 () override
 Rewind index. More...
 
virtual bool hasNext () override
 Check availability of next element. More...
 
virtual const pointer_typenext () override
 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 26 of file JLineAttributes.hh.

Member Typedef Documentation

Definition at line 32 of file JLineAttributes.hh.

Constructor & Destructor Documentation

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

Constructor.

Parameters
widthline width

Definition at line 40 of file JLineAttributes.hh.

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

Member Function Documentation

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

Get reference to unique instance of this class object.

Returns
reference to this class object

Definition at line 55 of file JLineAttributes.hh.

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

Set line width.

Parameters
widthline width

Definition at line 68 of file JLineAttributes.hh.

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

Rewind index.

Implements JLANG::JRewindable< T >.

Definition at line 79 of file JLineAttributes.hh.

80  {
81  index = 0;
82  }
virtual bool JROOT::JLineAttributes::hasNext ( )
inlineoverridevirtual

Check availability of next element.

Returns
true if the iteration has more elements; else false

Implements JLANG::JObjectIterator< T >.

Definition at line 90 of file JLineAttributes.hh.

91  {
92  return !this->empty();
93  }
virtual const pointer_type& JROOT::JLineAttributes::next ( )
inlineoverridevirtual

Get next element.

Returns
pointer to element

Implements JLANG::JObjectIterator< T >.

Definition at line 101 of file JLineAttributes.hh.

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

Get line attributes.

Parameters
indexindex
Returns
line attributes

Definition at line 123 of file JLineAttributes.hh.

124  {
125  return this->at(index%this->size());
126  }
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 >, and JLANG::JAbstractObjectReader< JDAQSummaryslice >.

Definition at line 90 of file JObjectIterator.hh.

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

Member Data Documentation

unsigned int JROOT::JLineAttributes::index
private

Definition at line 130 of file JLineAttributes.hh.


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