summaryrefslogtreecommitdiff
path: root/ACE/ace/Sample_History.inl
blob: 305c861ff09b72c2b9336d295bc472c0d217b3b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// -*- C++ -*-
ACE_BEGIN_VERSIONED_NAMESPACE_DECL

ACE_INLINE int
ACE_Sample_History::sample (ACE_UINT64 value)
{
  if (this->sample_count_ >= this->max_samples_)
    return -1;

  this->samples_[this->sample_count_++] = value;
  return 0;
}

ACE_INLINE ACE_UINT64
ACE_Sample_History::get_sample (size_t i) const
{
  if (this->sample_count_ <= i)
    return 0;

  return this->samples_[i];
}

ACE_INLINE size_t
ACE_Sample_History::max_samples (void) const
{
  return this->max_samples_;
}

ACE_INLINE size_t
ACE_Sample_History::sample_count (void) const
{
  return this->sample_count_;
}

ACE_END_VERSIONED_NAMESPACE_DECL