activemq-cpp-3.6.0
Main Page
Namespaces
Data Structures
Files
File List
Globals
TimerTaskHeap.h
Go to the documentation of this file.
1
/*
2
* Licensed to the Apache Software Foundation (ASF) under one or more
3
* contributor license agreements. See the NOTICE file distributed with
4
* this work for additional information regarding copyright ownership.
5
* The ASF licenses this file to You under the Apache License, Version 2.0
6
* (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
*
9
* http://www.apache.org/licenses/LICENSE-2.0
10
*
11
* Unless required by applicable law or agreed to in writing, software
12
* distributed under the License is distributed on an "AS IS" BASIS,
13
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
* See the License for the specific language governing permissions and
15
* limitations under the License.
16
*/
17
18
#ifndef _DECAF_INTERNAL_UTIL_TIMERTASKHEAP_H_
19
#define _DECAF_INTERNAL_UTIL_TIMERTASKHEAP_H_
20
21
#include <
decaf/util/Config.h
>
22
23
#include <
decaf/util/TimerTask.h
>
24
#include <
decaf/lang/Pointer.h
>
25
26
namespace
decaf {
27
namespace
internal {
28
namespace
util {
29
30
using
decaf::lang::Pointer
;
31
using
decaf::util::TimerTask
;
32
38
class
DECAF_API
TimerTaskHeap
{
39
private
:
40
41
// The default size of the Heap at creation.
42
static
const
int
DEFAULT_HEAP_SIZE = 256;
43
44
// Dynamic Array of TimerTasks used to represent the heap
45
std::vector<Pointer<TimerTask> > heap;
46
47
public
:
48
49
TimerTaskHeap
();
50
virtual
~
TimerTaskHeap
();
51
58
Pointer<TimerTask>
peek();
59
63
bool
isEmpty()
const
;
64
68
std::size_t size()
const
;
69
77
void
insert(
const
Pointer<TimerTask>
& task);
78
86
void
remove
(std::size_t pos);
87
91
void
reset();
92
96
void
adjustMinimum();
97
105
std::size_t deleteIfCancelled();
106
113
std::size_t find(
const
Pointer<TimerTask>
& task)
const
;
114
115
private
:
116
117
void
upHeap();
118
void
downHeap(std::size_t pos);
119
120
};
121
122
}}}
123
124
#endif
/* _DECAF_INTERNAL_UTIL_TIMERTASKHEAP_H_ */
src
main
decaf
internal
util
TimerTaskHeap.h
Generated on Mon Mar 4 2013 10:25:46 for activemq-cpp-3.6.0 by
1.8.1.2