statistics.cc (10011:69bd1011dcf3) statistics.cc (10453:d0365cc3d05f)
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 448 unchanged lines hidden (view full) ---

457}
458
459string
460Formula::str() const
461{
462 return root ? root->str() : "";
463}
464
1/*
2 * Copyright (c) 2003-2005 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 448 unchanged lines hidden (view full) ---

457}
458
459string
460Formula::str() const
461{
462 return root ? root->str() : "";
463}
464
465Handler resetHandler = NULL;
466Handler dumpHandler = NULL;
467
468void
469registerHandlers(Handler reset_handler, Handler dump_handler)
470{
471 resetHandler = reset_handler;
472 dumpHandler = dump_handler;
473}
474
465CallbackQueue dumpQueue;
466CallbackQueue resetQueue;
467
468void
475CallbackQueue dumpQueue;
476CallbackQueue resetQueue;
477
478void
479processResetQueue()
480{
481 resetQueue.process();
482}
483
484void
485processDumpQueue()
486{
487 dumpQueue.process();
488}
489
490void
469registerResetCallback(Callback *cb)
470{
471 resetQueue.add(cb);
472}
473
474bool _enabled = false;
475
476bool

--- 7 unchanged lines hidden (view full) ---

484{
485 if (_enabled)
486 fatal("Stats are already enabled");
487
488 _enabled = true;
489}
490
491void
491registerResetCallback(Callback *cb)
492{
493 resetQueue.add(cb);
494}
495
496bool _enabled = false;
497
498bool

--- 7 unchanged lines hidden (view full) ---

506{
507 if (_enabled)
508 fatal("Stats are already enabled");
509
510 _enabled = true;
511}
512
513void
514dump()
515{
516 if (dumpHandler)
517 dumpHandler();
518 else
519 fatal("No registered Stats::dump handler");
520}
521
522void
523reset()
524{
525 if (resetHandler)
526 resetHandler();
527 else
528 fatal("No registered Stats::reset handler");
529}
530
531void
492registerDumpCallback(Callback *cb)
493{
494 dumpQueue.add(cb);
495}
496
497} // namespace Stats
498
499void
500debugDumpStats()
501{
502 Stats::dump();
503}
532registerDumpCallback(Callback *cb)
533{
534 dumpQueue.add(cb);
535}
536
537} // namespace Stats
538
539void
540debugDumpStats()
541{
542 Stats::dump();
543}