Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of boost. Click here for the latest Boost documentation.
PrevUpHomeNext

Class rotation_at_time_point

boost::log::sinks::file::rotation_at_time_point

Synopsis

// In header: <boost/log/sinks/text_file_backend.hpp>


class rotation_at_time_point {
public:
  // types
  typedef bool result_type;

  // construct/copy/destruct
  explicit rotation_at_time_point(unsigned char, unsigned char, unsigned char);
  explicit rotation_at_time_point(date_time::weekdays, unsigned char = 0, 
                                  unsigned char = 0, unsigned char = 0);
  explicit rotation_at_time_point(gregorian::greg_day, unsigned char = 0, 
                                  unsigned char = 0, unsigned char = 0);

  // public member functions
  bool operator()() const;
};

Description

The class represents the time point of log file rotation. One can specify one of three types of time point based rotation:

  • rotation takes place every day, at the specified time

  • rotation takes place on the specified day of every week, at the specified time

  • rotation takes place on the specified day of every month, at the specified time

The time points are considered to be local time.

rotation_at_time_point public construct/copy/destruct

  1. explicit rotation_at_time_point(unsigned char hour, unsigned char minute, 
                                    unsigned char second);

    Creates a rotation time point of every day at the specified time

    Parameters:

    hour

    The rotation hour, should be within 0 and 23

    minute

    The rotation minute, should be within 0 and 59

    second

    The rotation second, should be within 0 and 59

  2. explicit rotation_at_time_point(date_time::weekdays wday, 
                                    unsigned char hour = 0, 
                                    unsigned char minute = 0, 
                                    unsigned char second = 0);

    Creates a rotation time point of each specified weekday at the specified time

    Parameters:

    hour

    The rotation hour, should be within 0 and 23

    minute

    The rotation minute, should be within 0 and 59

    second

    The rotation second, should be within 0 and 59

    wday

    The weekday of the rotation

  3. explicit rotation_at_time_point(gregorian::greg_day mday, 
                                    unsigned char hour = 0, 
                                    unsigned char minute = 0, 
                                    unsigned char second = 0);

    Creates a rotation time point of each specified day of month at the specified time

    Parameters:

    hour

    The rotation hour, should be within 0 and 23

    mday

    The monthday of the rotation, should be within 1 and 31

    minute

    The rotation minute, should be within 0 and 59

    second

    The rotation second, should be within 0 and 59

rotation_at_time_point public member functions

  1. bool operator()() const;

    Checks if it's time to rotate the file


PrevUpHomeNext