NCBI C++ ToolKit
Public Member Functions | Private Types | Private Attributes | List of all members
CAmbiguousRegion Class Reference

Search Toolkit Book for CAmbiguousRegion

Ambiguous portion of a sequence. More...

Public Member Functions

 CAmbiguousRegion ()
 Construct a new, empty, ambiguous region. More...
 
 CAmbiguousRegion (int value, int offset)
 Construct a new ambiguous region one letter in length. More...
 
 CAmbiguousRegion (int value, int offset, int length)
 Construct a new ambiguous region of a specified length. More...
 
bool Append (int value, int offset)
 Try to append a letter to an ambiguous region. More...
 
int Value () const
 Get the letter value for this region. More...
 
int Length () const
 Get the length of this ambiguous region. More...
 
int Offset () const
 Get the starting offset of the region. More...
 

Private Types

enum  { eMaxLength = 0xFFF }
 

Private Attributes

int m_Start
 Starting offset (offset of first base). More...
 
int m_End
 End offset (offset of first disincluded base.) More...
 
int m_Value
 Value of base (ambiguity letter). More...
 

Detailed Description

Ambiguous portion of a sequence.

This class represents a portion of a sequence that is ambiguous. The ambiguites represented by this region must have the same ambiguity letter, be contiguous, and span at most 4095 letters. If any of these conditions is not met, the issue may be solved by the use of multiple objects of this class.

Definition at line 51 of file writedb_convert.cpp.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
eMaxLength 

Maximum length of a region.

Definition at line 141 of file writedb_convert.cpp.

Constructor & Destructor Documentation

◆ CAmbiguousRegion() [1/3]

CAmbiguousRegion::CAmbiguousRegion ( )
inline

Construct a new, empty, ambiguous region.

Definition at line 54 of file writedb_convert.cpp.

◆ CAmbiguousRegion() [2/3]

CAmbiguousRegion::CAmbiguousRegion ( int  value,
int  offset 
)
inline

Construct a new ambiguous region one letter in length.

Parameters
valueAmbiguity letter to use. [in]
offsetStarting offset of the ambiguity. [in]

Definition at line 64 of file writedb_convert.cpp.

◆ CAmbiguousRegion() [3/3]

CAmbiguousRegion::CAmbiguousRegion ( int  value,
int  offset,
int  length 
)
inline

Construct a new ambiguous region of a specified length.

Parameters
valueAmbiguity letter to use. [in]
offsetStarting offset of the ambiguity. [in]
lengthLength of the ambiguity. [in]

Definition at line 75 of file writedb_convert.cpp.

Member Function Documentation

◆ Append()

bool CAmbiguousRegion::Append ( int  value,
int  offset 
)
inline

Try to append a letter to an ambiguous region.

The provided letter will be appended to this region if the resulting region would be 4095 or fewer letters in length, contain only one ambiguity letter, and be contiguous. If it would not, false is returned and this region is unchanged.

Parameters
valueAmbiguity letter to use. [in]
offsetStarting offset of the ambiguity. [in]
Returns
True if the letter was appended, false otherwise.

Definition at line 92 of file writedb_convert.cpp.

References _ASSERT, eMaxLength, Length(), m_End, m_Value, offset, and rapidjson::value.

◆ Length()

int CAmbiguousRegion::Length ( void  ) const
inline

Get the length of this ambiguous region.

Returns
Length of the region.

Definition at line 115 of file writedb_convert.cpp.

References m_End, and m_Start.

Referenced by Append().

◆ Offset()

int CAmbiguousRegion::Offset ( ) const
inline

Get the starting offset of the region.

Returns
Starting offset of the region.

Definition at line 122 of file writedb_convert.cpp.

References m_Start.

◆ Value()

int CAmbiguousRegion::Value ( void  ) const
inline

Get the letter value for this region.

Returns
Letter value.

Definition at line 108 of file writedb_convert.cpp.

References m_Value.

Member Data Documentation

◆ m_End

int CAmbiguousRegion::m_End
private

End offset (offset of first disincluded base.)

Definition at line 146 of file writedb_convert.cpp.

Referenced by Append(), and Length().

◆ m_Start

int CAmbiguousRegion::m_Start
private

Starting offset (offset of first base).

Definition at line 145 of file writedb_convert.cpp.

Referenced by Length(), and Offset().

◆ m_Value

int CAmbiguousRegion::m_Value
private

Value of base (ambiguity letter).

Definition at line 147 of file writedb_convert.cpp.

Referenced by Append(), and Value().


The documentation for this class was generated from the following file:
Modified on Fri Sep 20 14:57:40 2024 by modify_doxy.py rev. 669887