//
// Copyright (c) 2012 Daniel Lundin
//

#ifndef MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_
#define MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_

#include <memory>

#include "medida/types.h"

namespace medida {
    namespace reporting {
        class AbstractPollingReporter {

        public:
            AbstractPollingReporter();

            virtual ~AbstractPollingReporter();

            virtual void Shutdown();

            virtual void Start(Clock::duration period = std::chrono::seconds(5));

            virtual void Run();

        private:
            class Impl;

            std::unique_ptr<Impl> impl_;
        };
    }
}

#endif // MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_

//
// Copyright (c) 2012 Daniel Lundin
//

#ifndef MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_
#define MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_

#include <memory>

#include "medida/types.h"

namespace medida {
    namespace reporting {
        class AbstractPollingReporter {

        public:
            AbstractPollingReporter();

            virtual ~AbstractPollingReporter();

            virtual void Shutdown();

            // start should never be called after calling shutdown on this class
            //    (behavior if start after shutdown is undefined).
            virtual void Start(Clock::duration period = std::chrono::seconds(5));

            virtual void Run();

        private:
            class Impl;

            std::unique_ptr<Impl> impl_;
        };
    }
}

#endif // MEDIDA_REPORTING_ABSTRACT_POLLING_REPORTER_H_

Comment on abstract-polling-reporter to handle the shutdown followed by start racing to modify thread before it can be joined, it is not a valid usecase anyway, so handling it thru comment.
Comment on abstract-polling-reporter to handle the shutdown followed by start racing to modify thread before it can be joined, it is not a valid usecase anyway, so handling it thru comment.
