19 #ifndef SIGNAL_COUNTER_HPP
20 #define SIGNAL_COUNTER_HPP
22 #include <NodeBitmask.hpp>
23 #include <ErrorReporter.hpp>
34 void clearWaitingFor();
40 void clearWaitingFor(Uint32 nodeId);
41 void forceClearWaitingFor(Uint32 nodeId);
43 bool isWaitingFor(Uint32 nodeId)
const;
46 const char * getText()
const;
58 Uint32 getCount()
const;
64 if(!m_nodes.
get(nodeId)){
69 ErrorReporter::handleAssert(
"SignalCounter::set", __FILE__, __LINE__);
74 SignalCounter::isWaitingFor(Uint32 nodeId)
const {
75 return m_nodes.
get(nodeId);
80 SignalCounter::done()
const {
86 SignalCounter::getCount()
const {
92 SignalCounter::clearWaitingFor(Uint32 nodeId) {
93 if(m_nodes.
get(nodeId) && m_count > 0){
95 m_nodes.
clear(nodeId);
98 ErrorReporter::handleAssert(
"SignalCounter::clear", __FILE__, __LINE__);
103 SignalCounter::clearWaitingFor(){
110 SignalCounter::forceClearWaitingFor(Uint32 nodeId){
111 if(isWaitingFor(nodeId)){
112 clearWaitingFor(nodeId);
118 SignalCounter::operator=(Uint32 count){
126 SignalCounter::operator--(
int){
131 ErrorReporter::handleAssert(
"SignalCounter::operator--", __FILE__, __LINE__);
137 SignalCounter::operator++(
int){
144 SignalCounter::operator+=(Uint32
n){
151 SignalCounter::getText()
const {
152 static char buf[255];
153 static char nodes[NdbNodeBitmask::TextLength+1];
162 m_count = bitmask.
count();
169 assert(rg.m_nodes.
find(65) == NodeBitmask::NotFound);
170 memcpy(&m_nodes, &rg.m_nodes,
sizeof(m_nodes));
171 m_count = m_nodes.
count();