52 std::cerr <<
"&&&--- CountAndLimit::add \n";
53 std::cerr <<
"&&& Time now is " << now <<
"\n";
56 std::cerr <<
"&&& difftime is " << difftime(now, lastTime) <<
"\n" << std::flush;
60 if ((timespan >= 0) && (difftime(now, lastTime) >= timespan)) {
85 if ((limit < 0) || (
n <= limit)) {
93 if (r * limit != diff) {
132 #ifdef ELmapDumpTRACE 141 std::ostringstream
s;
142 s <<
"**** ELmap_limits Dump **** \n";
144 ELmap_limits::const_iterator
i;
145 for (i = m.begin(); i != m.end(); ++
i) {
147 s <<
" " << (*i).first <<
": " << lt.
limit <<
", " << lt.
timespan <<
"\n";
149 s <<
"--------------------------------------------\n";
151 boost::shared_array<char>
dump(
new char[s.str().size() + 1]);
152 strcpy(
dump.get(), s.str().c_str());
LimitAndTimespan(int lim=-1, int ts=-1, int ivl=-1)
CountAndLimit(int lim=-1, int ts=-1, int ivl=-1)
void add(const ELstring &context, bool reactedTo)
std::map< ELstring, LimitAndTimespan > ELmap_limits