Project: engagement_recognition

License: BSD

Dependencies:

Used by: None

All Packages

FileLogger Class Reference

#include <file_logger.h>

Inheritance diagram for FileLogger:

List of all members.

Static Public Member Functions

static void log (std::string filename, std::string output,...)
static void setDirectory (std::string directory)

Private Member Functions

 FileLogger ()
int openFile (std::string filename)

Static Private Member Functions

static FileLoggergetInstance ()

Private Attributes

std::string directory_
std::vector< std::string > filenames_
std::vector< FILE * > files_
pthread_mutex_t write_mutex_

Static Private Attributes

static FileLoggerlogger_ = NULL

Detailed Description

A singleton FileLogger class that allows one to open files for output and write output to the files.

Author:
Brett Ponsler (bponsler (at) wpi (dot) edu)

Definition at line 48 of file file_logger.h.


Constructor & Destructor Documentation

FileLogger::FileLogger (  )  [private]

Private constructor for the FileLogger class.

Definition at line 45 of file file_logger.cpp.


Member Function Documentation

FileLogger * FileLogger::getInstance (  )  [static, private]

Return the instance of the FileLogger class.

Returns:
The instance of the FileLogger class

Definition at line 56 of file file_logger.cpp.

void FileLogger::log ( std::string  filename,
std::string  output,
  ... 
) [static]

Write to a file.

Parameters:
file The index of the file to write to
output The string to output to

Definition at line 110 of file file_logger.cpp.

int FileLogger::openFile ( std::string  filename  )  [private]

Open a file for writing.

Parameters:
filename The filename to open
Returns:
The index of the file

Definition at line 82 of file file_logger.cpp.

void FileLogger::setDirectory ( std::string  directory  )  [static]

Set the directory used for this FileLogger.

Parameters:
directory The directory to use

Definition at line 69 of file file_logger.cpp.


Member Data Documentation

std::string FileLogger::directory_ [private]

The directory where to save files.

Definition at line 61 of file file_logger.h.

std::vector<std::string> FileLogger::filenames_ [private]

The vector of filenames that are currently open.

Definition at line 58 of file file_logger.h.

std::vector<FILE*> FileLogger::files_ [private]

The vector of files that are currently open.

Definition at line 55 of file file_logger.h.

FileLogger * FileLogger::logger_ = NULL [static, private]

The private instance of the FileLogger class.

Reimplemented from Loggable.

Definition at line 52 of file file_logger.h.

pthread_mutex_t FileLogger::write_mutex_ [private]

Mutex for writing to the files.

Definition at line 64 of file file_logger.h.


The documentation for this class was generated from the following files:

engagement_recognition
Author(s): Brett Ponsler (bponsler (at) wpi (dot) edu)
autogenerated on Fri Sep 9 10:35:49 2011