# PhasicFlow: src/phasicFlow/dictionary/entry/iEntry.hpp Source File
PhasicFlow is an open-source parallel DEM (discrete element method) package for simulating granular flow. It is developed in C++ and can be exectued on both GPU (like CUDA) and CPU.

iEntry.hpp
Go to the documentation of this file.
/*------------------------------- phasicFlow ---------------------------------
O C enter of
O O E ngineering and
O O M ultiscale modeling of
OOOOOOO F luid flow
------------------------------------------------------------------------------
Copyright (C): www.cemf.ir
email: hamid.r.norouzi AT gmail.com
------------------------------------------------------------------------------
Licence:
This file is part of phasicFlow code. It is a free software for simulating
granular and multiphase flows. You can redistribute it and/or modify it under
the terms of GNU General Public License v3 or any other later versions.
phasicFlow is distributed to help others in their research in the field of
granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-----------------------------------------------------------------------------*/
// based on OpenFOAM dictionary, with some modifications/simplifications
// to be tailored to our needs
#ifndef __iEntry_hpp__
#define __iEntry_hpp__
#include "types.hpp"
#include "typeInfo.hpp"
#include "uniquePtr.hpp"
namespace pFlow
{
class dictionary;
class iEntry
{
public:
static bool readKeyword(iIstream &is, word& keyword, token& tok );
static bool createEntry(dictionary& parDict, iIstream& is, bool hasBlockToken = false);
protected:
// keyWord of entry
word keyword_;
bool writeKeyword(iOstream& os)const;
public:
TypeInfo("iEntry");
iEntry()
{}
iEntry(const word& key)
{
// this moved here due to a very strange core dumped error!
keyword_ = key;
}
virtual ~iEntry()
{}
virtual const word& keyword() const
{
return keyword_;
}
virtual word& keyword()
{
return keyword_;
}
virtual word name()const
{
return keyword();
}
// global name of entry, separated with dots
virtual word globalName()const = 0;
virtual dictionary* dictPtr()
{
return nullptr;
}
virtual const dictionary* dictPtr() const
{
return nullptr;
}
virtual bool isDictionary() const
{
return false;
}
virtual const dictionary& parrentDict() const = 0;
virtual dictionary& dict() = 0;
virtual const dictionary& dict() const = 0;
virtual iEntry* clonePtr() const = 0;
virtual uniquePtr<iEntry> clone() const = 0;
virtual iEntry* clonePtr(const dictionary& parDict) const = 0;
virtual uniquePtr<iEntry> clone(const dictionary& parDict)const = 0;
virtual bool read(iIstream& is) = 0;
virtual bool write(iOstream& os) const =0;
};
iOstream& operator << (iOstream& os, const iEntry& e);
iIstream& operator >> (iIstream& is, iEntry& e);
} // pFlow
#endif //__iEntry_hpp__
pFlow::iEntry::clone
virtual uniquePtr< iEntry > clone() const =0
pFlow::token
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
Definition: token.hpp:44
pFlow::iEntry::globalName
virtual word globalName() const =0
types.hpp
pFlow::iEntry::isDictionary
virtual bool isDictionary() const
if this is a dictionary
Definition: iEntry.hpp:121
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::iEntry::parrentDict
virtual const dictionary & parrentDict() const =0
const ref to parrent dictionary
pFlow::iEntry::keyword_
word keyword_
Definition: iEntry.hpp:58
pFlow::iEntry::iEntry
iEntry(const word &key)
construct with a keyword
Definition: iEntry.hpp:74
pFlow::iEntry::keyword
virtual const word & keyword() const
return keyword
Definition: iEntry.hpp:88
pFlow::iEntry::TypeInfo
TypeInfo("iEntry")
Type info.
pFlow::iEntry::write
virtual bool write(iOstream &os) const =0
write to stream
pFlow
Definition: demGeometry.hpp:27
uniquePtr.hpp
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
pFlow::iEntry::read
virtual bool read(iIstream &is)=0
read from stream
pFlow::iEntry::createEntry
static bool createEntry(dictionary &parDict, iIstream &is, bool hasBlockToken=false)
create an entry (dataEntry or dictionary) from stream
Definition: iEntry.cpp:64
pFlow::operator>>
INLINE_FUNCTION iIstream & operator>>(iIstream &str, AB3History &ab3)
Definition: AdamsBashforth3.hpp:41
pFlow::iEntry::keyword
virtual word & keyword()
return keyword
Definition: iEntry.hpp:94
pFlow::operator<<
INLINE_FUNCTION iOstream & operator<<(iOstream &str, const AB3History &ab3)
Definition: AdamsBashforth3.hpp:57
pFlow::iEntry::dictPtr
virtual dictionary * dictPtr()
pointer to this dictionary
Definition: iEntry.hpp:109
pFlow::iEntry::dictPtr
virtual const dictionary * dictPtr() const
const pointer to this dictionary
Definition: iEntry.hpp:115
pFlow::iEntry::name
virtual word name() const
name/keyword of entry
Definition: iEntry.hpp:100
pFlow::iEntry::writeKeyword
bool writeKeyword(iOstream &os) const
Definition: iEntry.cpp:154
pFlow::iEntry::dict
virtual dictionary & dict()=0
ref to this dictionary, if it is a dictionary
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::iEntry::~iEntry
virtual ~iEntry()
destructor
Definition: iEntry.hpp:81
pFlow::iEntry::clonePtr
virtual iEntry * clonePtr() const =0
clone the object
pFlow::iEntry::readKeyword
static bool readKeyword(iIstream &is, word &keyword, token &tok)
read a keyword from stream
Definition: iEntry.cpp:32
typeInfo.hpp
pFlow::iEntry
Interface calss for data entry and dictionary
Definition: iEntry.hpp:42
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
pFlow::iEntry::iEntry
iEntry()
empty constructor
Definition: iEntry.hpp:70