summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/sys/PeriodicTimerImpl.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-01-27 22:20:51 +0000
committerAlan Conway <aconway@apache.org>2010-01-27 22:20:51 +0000
commit1297c818282f26838776df418d846e07457a7f7f (patch)
treed69c3b15f76b9d83a62462df3ca5211a45be7a4b /cpp/src/qpid/sys/PeriodicTimerImpl.h
parentd0df2e739d5fba4bfb9f549720518e55d6fa9c9c (diff)
downloadqpid-python-1297c818282f26838776df418d846e07457a7f7f.tar.gz
Added PeriodicTimer interface for periodic tasks that need cluster synchronization.
The ManagementAgent's periodic prociessing uses PeriodicTimer. PeriodicTimerImpl is the default implementation for stand-alone brokers, simple wrapper for sys::Timer. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@903866 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/sys/PeriodicTimerImpl.h')
-rw-r--r--cpp/src/qpid/sys/PeriodicTimerImpl.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/cpp/src/qpid/sys/PeriodicTimerImpl.h b/cpp/src/qpid/sys/PeriodicTimerImpl.h
new file mode 100644
index 0000000000..51ce0ffdf9
--- /dev/null
+++ b/cpp/src/qpid/sys/PeriodicTimerImpl.h
@@ -0,0 +1,45 @@
+#ifndef QPID_SYS_PERIODICTIMERIMPL_H
+#define QPID_SYS_PERIODICTIMERIMPL_H
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "PeriodicTimer.h"
+
+namespace qpid {
+namespace sys {
+
+/**
+ * Standalone broker implementation of PeriodicTimer.
+ */
+class PeriodicTimerImpl : public PeriodicTimer
+{
+ public:
+ PeriodicTimerImpl(Timer& timer);
+ void add(const Task& task, Duration period, const std::string& taskName);
+
+ private:
+ struct TaskImpl;
+ Timer& timer;
+};
+}} // namespace qpid::sys
+
+#endif /*!QPID_SYS_PERIODICTIMER_H*/