monotone

monotone Mtn Source Tree

Root/src/cache_logger.hh

1// Copyright (C) 2010 and later by various people
2// see monotone commit logs for details and authors
3//
4// This program is made available under the GNU GPL version 2.0 or
5// greater. See the accompanying file COPYING for details.
6//
7// This program is distributed WITHOUT ANY WARRANTY; without even the
8// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9// PURPOSE.
10
11#ifndef __CACHE_LOGGER_HH__
12#define __CACHE_LOGGER_HH__
13
14#include <boost/shared_ptr.hpp>
15
16class cache_logger_impl;
17
18class cache_logger
19{
20 boost::shared_ptr<cache_logger_impl> _impl;
21 int max_size;
22public:
23 // if given the empty filename, do nothing
24 explicit cache_logger(std::string const & filename, int max_size);
25
26 bool logging() const { return _impl; }
27
28 void log_exists(bool exists, int position, int item_count, int est_size) const;
29 void log_touch(bool exists, int position, int item_count, int est_size) const;
30 void log_fetch(bool exists, int position, int item_count, int est_size) const;
31 void log_insert(int items_removed, int item_count, int est_size) const;
32};
33
34#endif
35
36
37// Local Variables:
38// mode: C++
39// fill-column: 76
40// c-file-style: "gnu"
41// indent-tabs-mode: nil
42// End:
43// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status