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_8hpp_source.html below:

NCBI C++ ToolKit: include/objtools/blast/seqdb_reader/impl/seqdbatlas.hpp Source File

1 #ifndef OBJTOOLS_READERS_SEQDB__SEQDBATLAS_HPP 2 #define OBJTOOLS_READERS_SEQDB__SEQDBATLAS_HPP 60 #ifdef SEQDB_TRACE_LOGFILE 62 #define SEQDB_LOGCLASS_DEFAULT 1 63 #define SEQDB_LOGCLASS_MMAP 2 64 #define SEQDB_LOGCLASS_MFILE 4 65 #define SEQDB_LOGCLASS_GET 8 67 extern

ofstream * seqdb_logfile;

68 extern int

seqdb_logclass;

70 void

seqdb_log(

const char

* s);

71 void

seqdb_log(

const char

* s1,

const string

& s2);

73 void

seqdb_log(

int

cl,

const char

* s);

74 void

seqdb_log(

int

cl,

const char

* s1,

const string

& s2);

75 void

seqdb_log(

int

cl,

const char

* s1,

int

s2);

95 #define INT4IFY_STRING(a) \ 96  (((a[3] & 0xFF) << 24) | \ 97  ((a[2] & 0xFF) << 16) | \ 98  ((a[1] & 0xFF) << 8) | \ 101 #define CLASS_MARKER_FIELD(a) \ 102  static int x_GetClassMark() { return INT4IFY_STRING(a); } \ 103  static string x_GetMarkString() { return string((a a), 4); } \ 107 #define INIT_CLASS_MARK() m_ClassMark = x_GetClassMark() 110 #define CHECK_MARKER() \ 111  if (m_ClassMark != x_GetClassMark()) { \ 112  cout << "Marker="

<< m_ClassMark << endl; \

113

cout << "GetMrk=" << x_GetClassMark() << endl; \

114

cout << "\n!! Broken [" << x_GetMarkString() << "] mark detected.\n" \

115

<< "!! Mark is [" << hex << m_ClassMark << "], should be [" \

116

<< hex << x_GetClassMark() << "]." << endl; \

117

_ASSERT(m_ClassMark == x_GetClassMark()); \

121 #define BREAK_MARKER() m_ClassMark |= 0x20202020; 126 #define CLASS_MARKER_FIELD(a) 129 #define INIT_CLASS_MARK() 132 #define CHECK_MARKER() 135 #define BREAK_MARKER() 206 

volatile

bool

m_Locked;

317  enum

{e_MaxFileDescritors = 950};

337  bool

DoesFileExist(

const string

& fname);

351  return

DoesFileExist(fname.

GetPathS

());

366  bool

GetFileSize(

const string

& fname,

380  bool

GetFileSizeL(

const string

& fname,

TIndx

& length);

391  static void

RetRegion(

const char

* datap);

419  static char

*

Alloc

(

size_t

length,

bool

clear =

true

);

464  if

(m_UseLock && !locked.

m_Locked

) {

481  if

(m_UseLock && locked.

m_Locked

) {

498  Uint8

max_slice = e_MaxSlice64;

499  Uint8

sliceSize =

min

(max_slice,m_MaxFileSize);

513 #if defined(NCBI_OS_UNIX) 537  CMemoryFile

* GetMemoryFile(

const string

& fileName);

542

eFileCounterDecrement

545  CMemoryFile

* ReturnMemoryFile(

const string

& fileName);

550  case

eFileCounterIncrement:

551

m_OpenedFilesCount++;

554  case

eFileCounterDecrement:

555

m_OpenedFilesCount--;

561

m_MaxOpenedFilesCount =

max

(m_MaxOpenedFilesCount,m_OpenedFilesCount);

562  return

m_OpenedFilesCount;

572  const string

exts=

"hd|hi|nd|ni|pd|pi|si|sd|ti|td"

;

573  string

ext = filename.substr(filename.length()-2);

574  if

(exts.find(ext) !=

NPOS

) {

597  enum

{e_MaxSlice64 = 1 << 30};

617

m_Atlas.UnregisterExternal(*

this

);

700  void Init

(

const string

& filename) {

702  if

(!m_MappedFile || m_Filename != filename)

705

m_MappedFile = m_Atlas.ReturnMemoryFile(m_Filename);

708

m_Filename = filename;

710

m_MappedFile = m_Atlas.GetMemoryFile(m_Filename);

722

m_DataPtr = (

char

*)(m_MappedFile->GetPtr());

732

m_MappedFile = m_Atlas.ReturnMemoryFile(m_Filename);

752  return

(

const char

*)(m_DataPtr +

offset

);

757  return

(

const char

*)(m_DataPtr +

offset

);

static void * Alloc(size_t size)

Guard object for the SeqDBAtlas singleton.

DECLARE_CLASS_STATIC_FAST_MUTEX(m_Lock)

Lock protecting this object's fields.

static int m_Count

Count of users of the CSeqDBAtlas object.

static CSeqDBAtlas * m_Atlas

The CSeqDBAtlas object itself.

CAtlasMappedFile(const string &filename)

int ChangeOpenedFilseCount(EFilesCount fc)

const string GetSearchPath() const

Get BlastDB search path.

Uint8 m_MaxFileSize

Maxium file size.

bool DoesFileExist(const CSeqDB_Path &fname)

Check if file exists.

const string m_SearchPath

BlastDB search path.

static const string GenerateSearchPath()

Generate search path.

std::mutex m_FileMemMapMutex

int m_MaxOpenedFilesCount

Uint8 GetSliceSize()

Get the current slice size.

map< string, unique_ptr< CAtlasMappedFile > > m_FileMemMap

void Lock(CSeqDBLockHold &locked)

Lock the atlas.

CMutex m_Lock

Protects most of the critical regions of the SeqDB library.

bool m_UseLock

Use single atlas lock to protect critical regions.

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

std::mutex m_FileSizeMutex

Cache of file existence and length.

CSeqDBAtlas(const CSeqDBAtlas &)

Private method to prevent copy construction.

CNcbiStreamoff TIndx

The type used for file offsets.

int GetOpenedFilseCount(void)

void Unlock(CSeqDBLockHold &locked)

Unlock the atlas.

CSeqDBFileMemMap(class CSeqDBAtlas &atlas, const string &filename)

Constructor.

const char * GetFileDataPtr(const string &fname, TIndx offset)

Get a pointer to the specified offset.

void Init(const string &filename)

Initializes a memory map object.

void Clear()

Clears the memory mapobject.

CMemoryFile * m_MappedFile

const char * m_DataPtr

Points to the beginning of the data area.

~CSeqDBFileMemMap()

Destructor.

CSeqDBFileMemMap(class CSeqDBAtlas &atlas)

const char * GetFileDataPtr(TIndx offset)

volatile bool m_Locked

If this is true, this thread owns the atlas lock.

CSeqDBLockHold(class CSeqDBAtlas &atlas)

Constructor.

~CSeqDBMemReg()

Destructor.

CSeqDBMemReg(class CSeqDBAtlas &atlas)

Constructor.

CSeqDBMemReg(CSeqDBMemReg &oth)

Private method to prevent copy construction.

class CSeqDBAtlas & m_Atlas

This reference allows unlock on exit.

size_t m_Bytes

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

Hold a memory region refcount, return to atlas when destroyed.

CSeqDBAtlas & m_Atlas

Reference to the memory management layer.

const char * m_Ptr

Pointer to this object.

const string & GetPathS() const

Get the path as a string.

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

static CNcbiApplicationAPI * Instance(void)

Singleton method.

@ eFollowLinks

Follow symbolic links.

#define NCBI_THROW(exception_class, err_code, message)

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

const string & GetMsg(void) const

Get message string.

TErrCode GetErrCode(void) const

static string NormalizePath(const string &path, EFollowLinks follow_links=eIgnoreLinks)

Normalize a path.

static string GetCwd(void)

Get the current working directory.

uint64_t Uint8

8-byte (64-bit) unsigned integer

virtual const string & Get(const string &section, const string &name, TFlags flags=0) const

Get the parameter value.

virtual bool HasEntry(const string &section, const string &name=kEmptyStr, TFlags flags=0) const

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::streamoff CNcbiStreamoff

Portable alias for streamoff.

static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)

Find the pattern in the string.

#define NCBI_XOBJREAD_EXPORT

const TYPE & Get(const CNamedParameterList *param)

Multi-threading – atomic pointer exchange function.

Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...

Multi-threading – mutexes; rw-locks; semaphore.

#define INIT_CLASS_MARK()

Marker initializer for constructor.

string SeqDB_MakeOSPath(const string &dbs)

Return path with delimiters changed to platform preferred kind.

#define CLASS_MARKER_FIELD(a)

CSeqDBAtlas::TIndx TIndx

Index file.

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


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