NCBI C++ ToolKit
Functions | Variables
gencode_singleton.c File Reference

Implementation of the genetic code singleton. More...

#include <algo/blast/core/gencode_singleton.h>
#include "blast_dynarray.h"
+ Include dependency graph for gencode_singleton.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

void GenCodeSingletonInit ()
 Initialize the genetic code singleton. More...
 
void GenCodeSingletonFini ()
 Uninitialize the genetic code singleton. More...
 
Int2 GenCodeSingletonAdd (Uint4 gen_code_id, const Uint1 *gen_code_str)
 Add a genetic code entry to the singleton. More...
 
Uint1GenCodeSingletonFind (Uint4 gen_code_id)
 Returns the genetic code string for the requested genetic code id. More...
 

Variables

static SDynamicSGenCodeNodeArrayg_theInstance = NULL
 The singleton instance. More...
 

Detailed Description

Implementation of the genetic code singleton.

Definition in file gencode_singleton.c.

Function Documentation

Int2 GenCodeSingletonAdd ( Uint4  gen_code_id,
const Uint1 gen_code_str 
)

Add a genetic code entry to the singleton.

Parameters
gen_code_idgenetic code id [in]
gen_code_strgenetic code string [in]
Returns
0 if SUCCESS or already there, otherwise BLASTERR_MEMORY

Definition at line 56 of file gencode_singleton.c.

References ASSERT, DynamicSGenCodeNodeArray_Append(), SGenCodeNode::gc_id, and SGenCodeNode::gc_str.

Referenced by CAutomaticGenCodeSingleton::AddGeneticCode(), BOOST_AUTO_TEST_CASE(), CAutomaticGenCodeSingleton::CAutomaticGenCodeSingleton(), SetupQueries_OMF(), and SetupSubjects_OMF().

Uint1* GenCodeSingletonFind ( Uint4  gen_code_id)

Returns the genetic code string for the requested genetic code id.

Parameters
gen_code_idgenetic code id [in]
Returns
the genetic code string or NULL if this genetic code was not added to the singleton
Note
it's the API layer's responsibility to add least add BLAST_GENETIC_CODE to the singleton (for backwards compatibility and to meet the engine's expectations)

Definition at line 66 of file gencode_singleton.c.

References ASSERT, and DynamicSGenCodeNodeArray_Find().

Referenced by CAutomaticGenCodeSingleton::AddGeneticCode(), BLAST_ComputeTraceback_MT(), BLAST_PreliminarySearchEngine(), Blast_RedoAlignmentCore_MT(), BOOST_AUTO_TEST_CASE(), CAutomaticGenCodeSingleton::CAutomaticGenCodeSingleton(), s_MatchingSequenceInitialize(), SetupQueries_OMF(), and SetupSubjects_OMF().

void GenCodeSingletonFini ( )

Uninitialize the genetic code singleton.

Definition at line 50 of file gencode_singleton.c.

References DynamicSGenCodeNodeArrayFree().

Referenced by BOOST_AUTO_TEST_CASE(), and CAutomaticGenCodeSingleton::~CAutomaticGenCodeSingleton().

void GenCodeSingletonInit ( )

Initialize the genetic code singleton.

Note
this function is *NOT* thread safe, call it from the main thread
See also
CAutomaticGenCodeSingleton

Definition at line 41 of file gencode_singleton.c.

References ASSERT, DynamicSGenCodeNodeArrayNew(), and NULL.

Referenced by BOOST_AUTO_TEST_CASE(), and CAutomaticGenCodeSingleton::CAutomaticGenCodeSingleton().

Variable Documentation

SDynamicSGenCodeNodeArray* g_theInstance = NULL
static

The singleton instance.

Definition at line 38 of file gencode_singleton.c.

Modified on Sun Dec 17 15:50:34 2017 by modify_doxy.py rev. 546573