Design Pattern Examples
Overview of object-oriented design patterns
c/Bridge_FileLogger.h File Reference

Declaration of the CreateFileLogger() and DestroyFileLogger() factory functions used in the Bridge Pattern. More...

#include "Bridge_ILogger.h"
Include dependency graph for c/Bridge_FileLogger.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __BRIDGE_FILELOGGER_H__
 

Functions

ILoggerCreateFileLogger (const char *filename)
 Create an instance of an ILogger that outputs to a file.
 
void DestroyFileLogger (ILogger *logger)
 Destroy the given instance of an ILogger for outputting to a file.
 

Detailed Description

Declaration of the CreateFileLogger() and DestroyFileLogger() factory functions used in the Bridge Pattern.

Definition in file c/Bridge_FileLogger.h.

Macro Definition Documentation

◆ __BRIDGE_FILELOGGER_H__

#define __BRIDGE_FILELOGGER_H__

Definition at line 8 of file c/Bridge_FileLogger.h.

Function Documentation

◆ CreateFileLogger()

ILogger * CreateFileLogger ( const char *  filename)

Create an instance of an ILogger that outputs to a file.

Parameters
filenameName of the file to log to. The file will be overwritten.
Returns
Returns an ILogger instance to use for logging to a file; returns NULL if something went wrong in creating the logger.

Definition at line 96 of file Bridge_FileLogger.c.

References _File_LogError(), _File_LogInfo(), _File_LogTrace(), ILogger::data, ILogger::LogError, ILogger::LogInfo, and ILogger::LogTrace.

Referenced by CreateLogger().

◆ DestroyFileLogger()

void DestroyFileLogger ( ILogger logger)

Destroy the given instance of an ILogger for outputting to a file.

Parameters
loggerThe ILogger instance to destroy.

Definition at line 127 of file Bridge_FileLogger.c.

References ILogger::data.

Referenced by DestroyLogger().