summaryrefslogtreecommitdiff
path: root/ACE/ace/Sample_History.inl
diff options
context:
space:
mode:
authorWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
committerWilliam R. Otte <wotte@dre.vanderbilt.edu>2008-03-04 14:51:23 +0000
commit99aa8c60282c7b8072eb35eb9ac815702f5bf586 (patch)
treebda96bf8c3a4c2875a083d7b16720533c8ffeaf4 /ACE/ace/Sample_History.inl
parentc4078c377d74290ebe4e66da0b4975da91732376 (diff)
downloadATCD-99aa8c60282c7b8072eb35eb9ac815702f5bf586.tar.gz
undoing accidental deletion
Diffstat (limited to 'ACE/ace/Sample_History.inl')
-rw-r--r--ACE/ace/Sample_History.inl26
1 files changed, 26 insertions, 0 deletions
diff --git a/ACE/ace/Sample_History.inl b/ACE/ace/Sample_History.inl
new file mode 100644
index 00000000000..42eca62e69b
--- /dev/null
+++ b/ACE/ace/Sample_History.inl
@@ -0,0 +1,26 @@
+// -*- C++ -*-
+//
+// $Id$
+
+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_END_VERSIONED_NAMESPACE_DECL