A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/time__line_8hpp_source.html below:

NCBI C++ ToolKit: include/util/time_line.hpp Source File

1 #ifndef UTIL_TIME_LINE__HPP 2 #define UTIL_TIME_LINE__HPP 82  CTimeLine

(

unsigned

discr_factor, time_t tm);

84  void ReInit

(time_t tm = 0);

93  void AddObject

(time_t tm,

unsigned

object_id);

100  bool RemoveObject

(time_t object_time,

unsigned

object_id);

106  void MoveObject

(time_t old_time, time_t new_time,

unsigned

object_id);

137 #define TIMELINE_ITERATE(Var, Cont) \ 138  for ( typename TTimeLine::iterator Var = (Cont).begin(); Var != (Cont).end(); ++Var ) 140 #define TIMELINE_CONST_ITERATE(Var, Cont) \ 141  for ( typename TTimeLine::const_iterator Var = (Cont).begin(); Var != (Cont).end(); ++Var ) 145

: m_DiscrFactor(discr_factor)

171

m_TimeLine.resize(0);

172

m_TimeLineHead = (tm / m_DiscrFactor) * m_DiscrFactor;

173

m_TimeLine.push_back(0);

180  if

(object_time < m_TimeLineHead) {

181

object_time = m_TimeLineHead;

184  unsigned

slot = x_TimeLineSlot(object_time);

185

x_AddObjectToSlot(slot, object_id);

198  while

(slot >= m_TimeLine.size()) {

199

m_TimeLine.push_back(0);

207

m_TimeLine[slot] = bv;

216  if

(object_time < m_TimeLineHead) {

219  unsigned

slot = x_TimeLineSlot(object_time);

220  if

(slot < m_TimeLine.size()) {

225  bool

changed = bv->set_bit(object_id,

false

);

240  bool

changed = bv->set_bit(object_id,

false

);

264  bool

removed = RemoveObject(old_time, object_id);

266

RemoveObject(object_id);

268

AddObject(new_time, object_id);

277  if

(tm <= m_TimeLineHead)

280  unsigned

interval_head = (unsigned)((tm / m_DiscrFactor) * m_DiscrFactor);

281  unsigned

diff = (unsigned)(interval_head - m_TimeLineHead);

282  return

diff / m_DiscrFactor;

291  unsigned

slot = x_TimeLineSlot(tm);

292  for

(

unsigned i

= 0;

i

< slot; ++

i

) {

293  if

(m_TimeLine.size() == 0) {

302

m_TimeLine.pop_front();

304

m_TimeLineHead = m_TimeLineHead + slot * m_DiscrFactor;

Constants, lookup tables and typedefs.

Timeline class for fast approximate time tracking.

void MoveObject(time_t old_time, time_t new_time, unsigned object_id)

Move object from one time slot to another.

void AddObject(time_t tm, unsigned object_id)

Add object to the timeline.

CTimeLine(unsigned discr_factor, time_t tm)

void AddObjects(time_t tm, const TBitVector &objects)

deque< TBitVector * > TTimeLine

bool RemoveObject(time_t object_time, unsigned object_id)

Remove object from the time line, object_time defines time slot.

void EnumerateObjects(TBitVector *objects) const

Enumerate all objects registered in the timeline.

void ExtractObjects(time_t tm, TBitVector *objects)

Extracts all objects up to 'tm' and puts them into 'objects' vector.

CTimeLine(const CTimeLine &)

time_t GetHead() const

Return head of the timeline.

unsigned x_TimeLineSlot(time_t tm) const

Compute slot position in the timeline.

void x_AddObjectToSlot(unsigned time_slot, unsigned object_id)

Add object to the timeline using time slot.

CTimeLine & operator=(const CTimeLine &)

unsigned GetDiscrFactor() const

Time discretization factor.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

@ BM_GAP

GAP compression is ON.

Defines: CTimeFormat - storage class for time format.

#define TIMELINE_CONST_ITERATE(Var, Cont)

#define TIMELINE_ITERATE(Var, Cont)


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4