Flow123d  release_2.2.0-37-g336ee74
Classes | Macros | Typedefs | Enumerations | Functions | Variables
system.hh File Reference
#include <mpi.h>
#include "system/global_defs.h"
#include "system/exc_common.hh"
#include <stdio.h>
#include <boost/exception/detail/error_info_impl.hpp>
#include <boost/exception/info.hpp>
#include <string>
#include "system/exceptions.hh"

Go to the source code of this file.

Classes

struct  SystemInfo
 System structure for various global variables. More...
 

Macros

#define _BSD_SOURCE
 
#define strcmpi   strcasecmp
 
#define DIR_DELIMITER   '/'
 
#define OPERATOR_NEW_THROW_EXCEPTION
 
#define xprintf(...)   _xprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)
 

Typedefs

typedef enum MessageType MessageType
 Identifiers for various output messages. More...
 
typedef struct SystemInfo SystemInfo
 System structure for various global variables. More...
 

Enumerations

enum  MessageType {
  Msg = 0, MsgDbg, MsgLog, MsgVerb,
  Warn, UsrErr, Err, PrgErr
}
 Identifiers for various output messages. More...
 

Functions

int _xprintf (const char *const xprintf_file, const char *const xprintf_func, const int xprintf_line, MessageType type, const char *const fmt,...)
 Multi-purpose printing routine: messages, warnings, errors. More...
 
void chkerr (unsigned int ierr)
 Replacement of new/delete operator in the spirit of xmalloc. More...
 
void chkerr_assert (unsigned int ierr)
 

Variables

SystemInfo sys_info
 

Detailed Description

 * Copyright (C) 2015 Technical University of Liberec. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 3 as published by the Free Software Foundation. (http://www.gnu.org/licenses/gpl-3.0.en.html)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Definition in file system.hh.

Macro Definition Documentation

#define _BSD_SOURCE

Definition at line 35 of file system.hh.

#define DIR_DELIMITER   '/'

Definition at line 49 of file system.hh.

#define OPERATOR_NEW_THROW_EXCEPTION

Definition at line 53 of file system.hh.

#define strcmpi   strcasecmp

Definition at line 48 of file system.hh.

#define xprintf (   ...)    _xprintf(__FILE__, __func__, __LINE__, __VA_ARGS__)

Definition at line 92 of file system.hh.

Typedef Documentation

typedef enum MessageType MessageType

Identifiers for various output messages.

typedef struct SystemInfo SystemInfo

System structure for various global variables.

Enumeration Type Documentation

Identifiers for various output messages.

Enumerator
Msg 
MsgDbg 
MsgLog 
MsgVerb 
Warn 
UsrErr 
Err 
PrgErr 

Definition at line 63 of file system.hh.

Function Documentation

int _xprintf ( const char *const  xprintf_file,
const char *const  xprintf_func,
const int  xprintf_line,
MessageType  type,
const char *const  fmt,
  ... 
)

Multi-purpose printing routine: messages, warnings, errors.

Parameters
[in]xprintf_filecurrent file
[in]xprintf_funccurrent function
[in]xprintf_linecurrent line number
[in]typemessage type
[in]fmtmessage format
Returns
Same as printf, what internal printing routine returns.

Definition at line 85 of file system.cc.

void chkerr ( unsigned int  ierr)
inline

Replacement of new/delete operator in the spirit of xmalloc.

Up to my knowledge overloading of original new/delete is the only clean. Possibly disadvantage is that all 'new' calls in system and other templates become also overloaded.Operations on files and directories Wrapper to check return codes of C functions. In particular PETSC calls.

Definition at line 147 of file system.hh.

void chkerr_assert ( unsigned int  ierr)
inline

Wrapper to check return codes of C functions. In particular PETSC calls. This version do the check just as an debugging assert. So the code is empty in release version.

Definition at line 158 of file system.hh.

Here is the caller graph for this function:

Variable Documentation

SystemInfo sys_info

Definition at line 41 of file system.cc.