A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/seqdbatlas_8cpp_source.html below:

NCBI C++ ToolKit: src/objtools/blast/seqdb_reader/seqdbatlas.cpp Source File

43 #if defined(NCBI_OS_UNIX) 46 #include <sys/types.h> 49 #include <sys/resource.h> 86 template

<

class

TIn,

class

TOut>

91  if

(

sizeof

(TOut) <

sizeof

(TIn)) {

94  "Offset type does not span file length."

);

102

:m_UseLock (use_atlas_lock),

104

m_SearchPath (GenerateSearchPath())

119

it->second.get()->m_Count++;

121  return

it->second.get();

125  _TRACE

(

"Open File: "

<< fileName);

137

it->second.get()->m_Count--;

140

(it->second.get()->m_isIsam) && (it->second.get()->m_Count == 0)) {

142  LOG_POST

(

Info

<<

"Unmap max file descriptor reached: "

<< fileName);

166

length = it->second.second;

167  return

it->second.first;

171

pair<bool, TIndx>

val

;

175  if

(file_length >= 0) {

177  val

.second = SeqDB_CheckLength<Int8, TIndx>(file_length);

192

length =

val

.second;

205  void Set

(

const char

* x)

243

newcp =

new char

[length];

249  throw

std::bad_alloc();

253

memset(newcp, 0, length);

256  catch

(std::bad_alloc) {

258  "CSeqDBAtlas::Alloc: allocation failed."

);

277  size_t

bytes = memreg.

m_Bytes

;

351

: m_Atlas(atlas), m_Ptr(ptr)

CSeqDBAtlasHolder(CSeqDBLockHold *lockedp, bool use_atlas_lock)

Constructor.

static int m_Count

Count of users of the CSeqDBAtlas object.

~CSeqDBAtlasHolder()

Destructor.

CSeqDBAtlas & Get()

Get the CSeqDBAtlas object.

static CSeqDBAtlas * m_Atlas

The CSeqDBAtlas object itself.

static void RetRegion(const char *datap)

Free allocated memory.

bool GetFileSizeL(const string &fname, TIndx &length)

Get size of a file.

void RegisterExternal(CSeqDBMemReg &memreg, size_t bytes, CSeqDBLockHold &locked)

Register externally allocated memory.

int ChangeOpenedFilseCount(EFilesCount fc)

bool DoesFileExist(const string &fname)

Check if file exists.

CMemoryFile * ReturnMemoryFile(const string &fileName)

void UnregisterExternal(CSeqDBMemReg &memreg)

Unregister externally allocated memory.

Uint8 m_MaxFileSize

Maxium file size.

~CSeqDBAtlas()

The destructor unmaps and frees all associated memory.

bool GetFileSize(const string &fname, TIndx &length)

Get size of a file.

static char * Alloc(size_t length, bool clear=true)

Allocate memory that atlas will keep track of.

std::mutex m_FileMemMapMutex

CMemoryFile * GetMemoryFile(const string &fileName)

int m_MaxOpenedFilesCount

CSeqDBAtlas(bool use_atlas_lock)

Constructor.

map< string, unique_ptr< CAtlasMappedFile > > m_FileMemMap

void Lock(CSeqDBLockHold &locked)

Lock the atlas.

map< string, pair< bool, TIndx > > m_FileSize

std::mutex m_FileSizeMutex

Cache of file existence and length.

CNcbiStreamoff TIndx

The type used for file offsets.

int GetOpenedFilseCount(void)

void Unlock(CSeqDBLockHold &locked)

Unlock the atlas.

EErrCode

Errors are classified into one of two types.

@ eFileErr

Files were missing or contents were incorrect.

@ eArgErr

Argument validation failed.

class CSeqDBAtlas & m_Atlas

This reference allows unlock on exit.

~CSeqDBLockHold()

Destructor.

size_t m_Bytes

This object "owns" this many bytes of the atlas memory bound.

CSeqDBAtlas & m_Atlas

Reference to the memory management layer.

CSeqDB_AtlasRegionHolder(CSeqDBAtlas &atlas, const char *ptr)

Constructor.

const char * m_Ptr

Pointer to this object.

~CSeqDB_AtlasRegionHolder()

Destructor.

const_iterator end() const

const_iterator find(const key_type &key) const

#define LOG_POST(message)

This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...

#define NCBI_THROW(exception_class, err_code, message)

Generic macro to throw an exception, given the exception class, error code and message string.

void Info(CExceptionArgs_Base &args)

int64_t Int8

8-byte (64-bit) signed integer

uint64_t Uint8

8-byte (64-bit) unsigned integer

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is whole

const GenericPointer< typename T::ValueType > T2 value

DEFINE_CLASS_STATIC_FAST_MUTEX(CSeqDBAtlasHolder::m_Lock)

void SeqDB_ThrowException(CSeqDBException::EErrCode code, const string &msg)

Thow a SeqDB exception; this is seperated into a function primarily to allow a breakpoint to be set.

TOut SeqDB_CheckLength(TIn value)

Check the size of a number relative to the scope of a numeric type.

The SeqDB memory management layer.

#define CHECK_MARKER()

Assertion to verify the marker.

#define BREAK_MARKER()

Make the marker of this class invalid.

Defines exception class and several constants for SeqDB.

This file defines several SeqDB utility functions related to byte order and file system portability.

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

Simple idiom for RIIA with malloc + free.

const char * m_Array

Pointer to malloced memory.

CSeqDBAutoFree()

Constructor.

void Set(const char *x)

Specify a malloced area of memory.

~CSeqDBAutoFree()

Destructor will free that memory.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4