Defines | Enumerations | Functions

ocsReadWriteTools.hh File Reference

#include "ocsConst.hh"
#include "ocsReducedModelTools.hh"
#include <iostream.h>
#include <string.h>
#include <math.h>
#include <fstream.h>
#include <complex.h>
#include <stdlib.h>
#include <stdio.h>
#include <strstream>
#include <string>

Go to the source code of this file.

Defines

#define _OCS_READ_WRITE_ENUMERATORS_
#define _OCS_TYPE_SIMULATION_
#define _OCS_SYSTEM_HDRS_

Enumerations

enum  BoundsFlagEnumerator { LOWER_ONLY = 1, UPPER_ONLY = 2, LOWER_AND_UPPER = 3, NO_BOUNDS = 4 }
enum  InputParameterOptionsEnumerator { MANDATORY = 1, OPTIONAL_WARNING = 2, OPTIONAL_NO_WARNING = 3 }
enum  typeSimulation { SCALAR = 1, VECTOR = 2 }

Functions

int ReadInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, int DefaultValue, ifstream *InFile, bool DebugLevel)
long ReadLongInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, int DefaultValue, ifstream *InFile, bool DebugLevel)
double ReadDouble (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, double DefaultValue, ifstream *InFile, bool DebugLevel)
string ReadString (string ParameterName, InputParameterOptionsEnumerator InputParameterOption, string DefaultValue, ifstream *InFile, bool DebugLevel)
int ReadInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, int DefaultValue, ifstream *InFile)
long ReadLongInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, int DefaultValue, ifstream *InFile)
double ReadDouble (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, double DefaultValue, ifstream *InFile)
string ReadString (string ParameterName, InputParameterOptionsEnumerator InputParameterOption, string DefaultValue, ifstream *InFile)
int ReadInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile, bool DebugLevel)
long ReadLongInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile, bool DebugLevel)
double ReadDouble (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile, bool DebugLevel)
string ReadString (string ParameterName, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile, bool DebugLevel)
void MissingParameter (string ParameterName, InputParameterOptionsEnumerator InputParameterOption, bool DebugLevel)
int ReadInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile)
long ReadLongInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile)
double ReadDouble (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile)
string ReadString (string ParameterName, InputParameterOptionsEnumerator InputParameterOption, ifstream *InFile)
void MissingParameter (string ParameterName, InputParameterOptionsEnumerator InputParameterOption)
int ReadInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, ifstream *InFile, bool DebugLevel)
long ReadLongInt (string ParameterName, string UnitsString, long LowerBound, long UpperBound, BoundsFlagEnumerator BoundsFlag, ifstream *InFile, bool DebugLevel)
double ReadDouble (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, ifstream *InFile, bool DebugLevel)
string ReadString (string ParameterName, ifstream *InFile, bool DebugLevel)
int ReadInt (string ParameterName, string UnitsString, int LowerBound, int UpperBound, BoundsFlagEnumerator BoundsFlag, ifstream *InFile)
long ReadLongInt (string ParameterName, string UnitsString, long LowerBound, long UpperBound, BoundsFlagEnumerator BoundsFlag, ifstream *InFile)
double ReadDouble (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, ifstream *InFile)
string ReadString (string ParameterName, ifstream *InFile)
void cerror (char *msg)
void LogFileSeparator ()
void LogFileStars ()
void LogFileAbortWithErrorMsg (string ErrorMsg)
string WriteTypeSimulation (typeSimulation TypeSimulation)
double * ReadVectorOfDoubles (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, double DefaultValue, unsigned NumbersOfElements, ifstream *InFile)
double * ReadVectorOfDoubles (string ParameterName, string UnitsString, double LowerBound, double UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, double DefaultValue, unsigned NumberOfElements, ifstream *InFile, bool DebugLevel)
void WrongTypeParameter (string ParameterName)
void WrongTypeParameter (string ParameterName, bool DebugLevel)
unsigned ReadUnsignedInt (string ParameterName, string UnitsString, unsigned LowerBound, unsigned UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, unsigned DefaultValue, ifstream *InFile, bool DebugLevel)
unsigned ReadUnsignedInt (string ParameterName, string UnitsString, unsigned LowerBound, unsigned UpperBound, BoundsFlagEnumerator BoundsFlag, InputParameterOptionsEnumerator InputParameterOption, unsigned DefaultValue, ifstream *InFile)

Define Documentation

#define _OCS_READ_WRITE_ENUMERATORS_
#define _OCS_SYSTEM_HDRS_
#define _OCS_TYPE_SIMULATION_

Enumeration Type Documentation

Enumerator:
LOWER_ONLY 
UPPER_ONLY 
LOWER_AND_UPPER 
NO_BOUNDS 
Enumerator:
MANDATORY 
OPTIONAL_WARNING 
OPTIONAL_NO_WARNING 
Enumerator:
SCALAR 
VECTOR 

Function Documentation

void cerror ( char *  msg  ) 
void LogFileAbortWithErrorMsg ( string  ErrorMsg  ) 
void LogFileSeparator (  ) 

References LogFile.

Referenced by ReduOptAmplifier::AmplifyOptSignal(), OptAmplifier::AmplifyOptSignal(), ElecSignalStat::CheckGaussianStatisticsInitialization(), ChiSquareReceiver::ChiSquareReceiver(), Histogram2D::Clear(), OptSignal::ConstructOptSignal(), ReduOptFiber::CopyReduOptFiber(), ElecFilter::ElecFilter(), ElecSignalStat::ElecSignalStat(), GaussianReceiver::GaussianReceiver(), OptSignal::GenerateSignalStringUsingInputSequence(), Histogram2D::Histogram2D(), PostDispCompSubSystem::InitApril2003(), ElecEqualizer::InitElecEqualizer(), Histogram::InitHistogram(), ElecSignalStat::InitPatternStats(), ReceiverSubsystem::InitSimplifiedReceiver(), LogFileAbortWithErrorMsg(), LumpedLoss::LumpedLoss(), MachZehnder::MachZehnder(), NoiseCovariance::NoiseCovariance(), OptAmplifier::OptAmplifier(), OptDataWriter::OptDataWriter(), OptFiber::OptFiber(), OptFiberLocalError::OptFiberLocalError(), OptFilter::OptFilter(), OptSignal::OptSignal(), OptSpectrumAnalyzer::OptSpectrumAnalyzer(), Photodetector::Photodetector(), PolarizTransformer::PolarizTransformer(), PolDepAttenuator::PolDepAttenuator(), PostDispCompSubSystem::PostDispCompSubSystem(), ReduOptSignal::ProcessReduOptSignalParameters(), RamanAmp::RamanAmp(), RanNumGen::RanNumGen(), ElecFilter::ReadElecGain(), ElecFilter::ReadElecPhase(), ElecFilter::ReadElecPhasePaola(), OptAmplifier::ReadGainPowerDependent(), OptAmplifier::ReadGainProfile(), OptAmplifier::ReadInGainFlatenFilter(), OptAmplifier::ReadInPolynomialFilter(), RamanAmp::ReadPlainFileGainLoss(), RamanAmp::ReadRamanGainLossWavelengthGrid(), OptAmplifier::ReadSignalCrossSection(), ReceiverSemiAnalytical::ReceiverSemiAnalytical(), ReceiverSubsystem::ReceiverSubsystemInit(), ReceiverSubsystem::ReceiveSignalBackToBack(), ReceiverSemiAnalytical::ReceiveSignalBackToBackMonteCarlo(), ReduLumpedLoss::ReduLumpedLoss(), ReduOptAmplifier::ReduOptAmplifier(), ReduOptFiber::ReduOptFiber(), ReduPolarizTransformer::ReduPolarizTransformer(), SaturableAbsorber::SaturableAbsorber(), ElecFilter::Set_f_3dB_ElecFilter(), ElecFilter::SetFreqFWHM_ElecFilter(), OptFilter::SetFreqFWHM_OptFilter(), OptFiber::SetFstOrDispFiber(), RamanAmp::SetGainProfile(), OptFiber::SetGammaFiber(), Histogram2D::SetMaxY(), ElecSignalStat::SetOptElecFiltersForGaussianStatistics(), OptFiber::SetSndOrDispFiber(), RamanAmp::WriteCentralWavelength(), RamanAmp::WriteEqIntgData(), Histogram2D::WriteEyeDiagramHistogram(), Histogram2D::WriteFile_pdf2D(), RamanAmp::WriteGainShapeData(), ReduOptAmplifier::WriteSteadyInputPowerVersusOutputPower(), ReduOptAmplifier::WriteSteadyStateGainVersusPower(), and OptAmplifier::WriteSteadyStateGainVersusPower().

void LogFileStars (  ) 
void MissingParameter ( string  ParameterName,
InputParameterOptionsEnumerator  InputParameterOption 
)
void MissingParameter ( string  ParameterName,
InputParameterOptionsEnumerator  InputParameterOption,
bool  DebugLevel 
)
double ReadDouble ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile,
bool  DebugLevel 
)
double ReadDouble ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile 
)
double ReadDouble ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
ifstream *  InFile,
bool  DebugLevel 
)
double ReadDouble ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
double  DefaultValue,
ifstream *  InFile,
bool  DebugLevel 
)
double ReadDouble ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
ifstream *  InFile 
)
double ReadDouble ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
double  DefaultValue,
ifstream *  InFile 
)
int ReadInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile,
bool  DebugLevel 
)
int ReadInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
ifstream *  InFile,
bool  DebugLevel 
)
int ReadInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
int  DefaultValue,
ifstream *  InFile 
)
int ReadInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
ifstream *  InFile 
)
int ReadInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile 
)
int ReadInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
int  DefaultValue,
ifstream *  InFile,
bool  DebugLevel 
)
long ReadLongInt ( string  ParameterName,
string  UnitsString,
long  LowerBound,
long  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
ifstream *  InFile,
bool  DebugLevel 
)
long ReadLongInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile,
bool  DebugLevel 
)
long ReadLongInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
int  DefaultValue,
ifstream *  InFile,
bool  DebugLevel 
)
long ReadLongInt ( string  ParameterName,
string  UnitsString,
long  LowerBound,
long  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
ifstream *  InFile 
)
long ReadLongInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
int  DefaultValue,
ifstream *  InFile 
)

References ReadLongInt().

Referenced by RanNumGen::RanNumGen(), and ReadLongInt().

long ReadLongInt ( string  ParameterName,
string  UnitsString,
int  LowerBound,
int  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile 
)

References ReadLongInt().

string ReadString ( string  ParameterName,
ifstream *  InFile 
)

References LogFile, and ReadString().

string ReadString ( string  ParameterName,
InputParameterOptionsEnumerator  InputParameterOption,
string  DefaultValue,
ifstream *  InFile 
)
string ReadString ( string  ParameterName,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile 
)
string ReadString ( string  ParameterName,
InputParameterOptionsEnumerator  InputParameterOption,
string  DefaultValue,
ifstream *  InFile,
bool  DebugLevel 
)

References LogFile, and MissingParameter().

string ReadString ( string  ParameterName,
InputParameterOptionsEnumerator  InputParameterOption,
ifstream *  InFile,
bool  DebugLevel 
)

References LogFile, and MissingParameter().

string ReadString ( string  ParameterName,
ifstream *  InFile,
bool  DebugLevel 
)

References LogFile.

unsigned ReadUnsignedInt ( string  ParameterName,
string  UnitsString,
unsigned  LowerBound,
unsigned  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
unsigned  DefaultValue,
ifstream *  InFile,
bool  DebugLevel 
)
unsigned ReadUnsignedInt ( string  ParameterName,
string  UnitsString,
unsigned  LowerBound,
unsigned  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
unsigned  DefaultValue,
ifstream *  InFile 
)

References ReadUnsignedInt().

Referenced by ReadUnsignedInt().

double* ReadVectorOfDoubles ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
double  DefaultValue,
unsigned  NumbersOfElements,
ifstream *  InFile 
)

References ReadVectorOfDoubles().

Referenced by ReadVectorOfDoubles().

double* ReadVectorOfDoubles ( string  ParameterName,
string  UnitsString,
double  LowerBound,
double  UpperBound,
BoundsFlagEnumerator  BoundsFlag,
InputParameterOptionsEnumerator  InputParameterOption,
double  DefaultValue,
unsigned  NumberOfElements,
ifstream *  InFile,
bool  DebugLevel 
)
string WriteTypeSimulation ( typeSimulation  TypeSimulation  ) 
void WrongTypeParameter ( string  ParameterName  ) 
void WrongTypeParameter ( string  ParameterName,
bool  DebugLevel 
)

References LogFile, and LogFileStars().