NCBI C++ ToolKit
Public Types | Public Member Functions | Private Types | Private Member Functions
CUser_object Class Reference

Represents ASN.1 type User-object defined in file general.asn

Search Toolkit Book for CUser_object

#include <objects/general/User_object.hpp>

+ Inheritance diagram for CUser_object:
+ Collaboration diagram for CUser_object:

List of all members.

Public Types

enum  EParseField { eParse_String, eParse_Number }
 how to interpret the value in the AddField() conversion functions below. More...
enum  ELabelContent { eType, eContent, eBoth }
 enum controlling what to return for a label this mirrors a request inside of feature::GetLabel() More...
enum  ECategory { eCategory_Unknown = -1, eCategory_Experiment }
 enums for implicit typing of user objects More...
enum  EExperiment { eExperiment_Unknown = -1, eExperiment_Sage }
 sub-category experiment More...
enum  EObjectType { eObjectType_Unknown = -1, eObjectType_DBLink, eObjectType_StructuredComment, eObjectType_OriginalId }
 Object Type. More...

Public Member Functions

 CUser_object (void)
 constructor
 ~CUser_object (void)
 destructor
CUser_objectAddField (const string &label, const string &value, EParseField parse=eParse_String)
 add a data field to the user object that holds a given value
CUser_objectAddField (const string &label, const char *value, EParseField parse=eParse_String)
CUser_objectAddField (const string &label, int value)
CUser_objectAddField (const string &label, double value)
CUser_objectAddField (const string &label, bool value)
CUser_objectAddField (const string &label, const vector< string > &value)
CUser_objectAddField (const string &label, const vector< int > &value)
CUser_objectAddField (const string &label, const vector< double > &value)
CUser_objectAddField (const string &label, CUser_object &value)
CUser_objectAddField (const string &label, const vector< CRef< CUser_object > > &value)
CUser_objectAddField (const string &label, const vector< CRef< CUser_field > > &value)
const CUser_fieldGetField (const string &str, const string &delim=".") const
 Access a named field in this user object.
CConstRef< CUser_fieldGetFieldRef (const string &str, const string &delim=".") const
CUser_fieldSetField (const string &str, const string &delim=".", const string &obj_subtype=kEmptyStr)
 Access a named field in this user object.
CRef< CUser_fieldSetFieldRef (const string &str, const string &delim=".", const string &obj_subtype=kEmptyStr)
bool HasField (const string &str, const string &delim=".") const
 Verify that a named field exists.
void GetLabel (string *label, ELabelContent mode=eContent) const
 Append a label to label.
ECategory GetCategory (void) const
 accessors: classify a given user object
EExperiment GetExperimentType (void) const
 sub-category accessors:
const CUser_objectGetExperiment (void) const
CUser_objectSetCategory (ECategory category)
 format a user object as a given type.
CUser_objectSetExperiment (EExperiment category)
 format a user object as a given type.
EObjectType GetObjectType () const
void SetObjectType (EObjectType obj_type)

Private Types

typedef CUser_object_Base Tparent

Private Member Functions

 CUser_object (const CUser_object &value)
 Prohibit copy constructor and assignment operator.
CUser_objectoperator= (const CUser_object &value)

Detailed Description

Definition at line 50 of file User_object.hpp.


Member Typedef Documentation

Reimplemented from CUser_object_Base.

Definition at line 52 of file User_object.hpp.


Member Enumeration Documentation

enums for implicit typing of user objects

general category

Enumerator:
eCategory_Unknown 
eCategory_Experiment 

Definition at line 125 of file User_object.hpp.

sub-category experiment

Enumerator:
eExperiment_Unknown 
eExperiment_Sage 

Definition at line 131 of file User_object.hpp.

enum controlling what to return for a label this mirrors a request inside of feature::GetLabel()

Enumerator:
eType 
eContent 
eBoth 

Definition at line 110 of file User_object.hpp.

Object Type.

Enumerator:
eObjectType_Unknown 
eObjectType_DBLink 
eObjectType_StructuredComment 
eObjectType_OriginalId 

Definition at line 152 of file User_object.hpp.

how to interpret the value in the AddField() conversion functions below.

Enumerator:
eParse_String 

Add string even if all numbers.

eParse_Number 

Parse a real or integer number, otherwise string.

Definition at line 60 of file User_object.hpp.


Constructor & Destructor Documentation

CUser_object::CUser_object ( void  ) [inline]

constructor

Definition at line 175 of file User_object.hpp.

Referenced by SetCategory().

destructor

Definition at line 52 of file User_object.cpp.

Prohibit copy constructor and assignment operator.


Member Function Documentation

add a data field to the user object that holds a given value

Definition at line 182 of file User_object.cpp.

References CUtf8::AsUTF8(), eEncoding_UTF8, eParse_Number, eParse_String, CUser_object_Base::SetData(), CUser_field_Base::SetData(), CUser_field_Base::SetLabel(), NStr::StringToDouble(), and NStr::StringToInt().

Referenced by AddField(), CTableAnnotDataSource::AddSeqLoc(), CStructuredCommentsReader::AddStructuredComment(), CConvertComment::ApplyToComment(), variation_ref::AttachAssertedSequence(), BOOST_AUTO_TEST_CASE(), CTableImportDataSource::ConvertToSeqAnnot(), CAnnotationASN1::CImplementationData::create_internal_feature(), CAnnotationASN1::CImplementationData::create_ModelEvidence_user_object(), CTableAnnotDataSource::CreateFeature(), CBlastFormatUtil::CreateSeqAnnotFromSeqAlignSet(), CWigObjectLoader::Execute(), CTableImportDataSource::ExportTableParms(), CVDBGraphSeqIterator::GetAnnot(), MakeCompartment(), CCSraAlignIterator::MakeMatchAnnotIndicator(), CBam2Seq_graph::MakeSeq_annot(), CAnnotationASN1::CImplementationData::model2spliced_seq_align(), CTableXformPanel::OnSaveImportParmsClick(), CRepeatToFeat::operator()(), CFastaReader::ParseDefLine(), variation_ref::CVariationUtil::PrecursorToProt(), CUCSCRegionReader::ReadSeqAnnot(), CMicroArrayReader::ReadSeqAnnot(), CBedReader::ReadSeqAnnot(), CDemoSeqQaApp::Run(), CDockManager::SaveLayout(), NSNPWebServices::Search(), CGBenchService::SendAppFinish(), CGBenchService::SendAppStart(), SetCategory(), sRectToFields(), CNetBlastJobDescriptor::ToUserObject(), CBLASTParams::ToUserObject(), CComplexRelation::ToUserObject(), CRelation::UserObjectFromRelation(), CFeature_table_reader_imp::x_AddQualifierToImp(), CReaderBase::x_AssignTrackData(), CBamLoadingJob::x_CreateDataLoader(), CBamLoadingJob::x_CreateProjectItems(), CGvfReader::x_FeatureSetExt(), CGff2Reader::x_FeatureSetGffInfo(), CUIDataSourceService::x_GetDataSourceDescr(), CReaderBase::x_MakeAsnConversionInfo(), CGff2Reader::x_ParseBrowserLineGff(), CGvfReader::x_ParseStructuredCommentGff(), CGff2Reader::x_ParseTrackLineGff(), CNetBLASTUIDataSource::x_SaveJobDescriptors(), CBedReader::x_SetFeatureDisplayData(), CReaderBase::x_SetTrackData(), CBedReader::x_SetTrackData(), CGff2Reader::x_SetTrackDataToSeqEntry(), CBLASTParams::x_ToUserObject(), CVcfReader::xProcessFilter(), CVcfReader::xProcessFormat(), CVcfReader::xProcessHeaderLine(), CVcfReader::xProcessInfo(), CVcfReader::xProcessScore(), CBedReader::xSetFeatureBedData(), CMicroArrayReader::xSetFeatureDisplayData(), CBedReader::xSetFeatureLocationBlock(), CBedReader::xSetFeatureLocationChrom(), CBedReader::xSetFeatureLocationThick(), and CMicroArrayReader::xSetTrackData().

CUser_object & CUser_object::AddField ( const string label,
const char *  value,
EParseField  parse = eParse_String 
) [inline]

Definition at line 181 of file User_object.hpp.

References AddField().

CUser_object & CUser_object::AddField ( const string label,
int  value 
)
CUser_object & CUser_object::AddField ( const string label,
double  value 
)
CUser_object & CUser_object::AddField ( const string label,
bool  value 
)
CUser_object & CUser_object::AddField ( const string label,
const vector< int > &  value 
)
CUser_object & CUser_object::AddField ( const string label,
const vector< double > &  value 
)
const CUser_field & CUser_object::GetField ( const string str,
const string delim = "." 
) const

Access a named field in this user object.

This is a little sneaky in that it interprets a delimiter for recursion. This version will throw an exception if the field doesn't exist.

Definition at line 61 of file User_object.cpp.

References CConstRef< C, Locker >::Empty(), GetFieldRef(), and NCBI_THROW.

Referenced by CChangeStructuredCommentKeyword::ApplyToCSeq_entry_user(), CReorderStructuredComment::ApplyToCSeq_entry_user(), BOOST_AUTO_TEST_CASE(), CLDBlockGlyph::CLDBlockGlyph(), CAnnotationASN1::CImplementationData::create_ModelEvidence_user_object(), CBLASTParams::FromUserObject(), CComplexRelation::FromUserObject(), GetBestCdsForMrna(), GetBestMrnaForCds(), CConstSageData::GetCount(), GetDBLinkIDs(), CConstSageData::GetField(), CGenomeAnnotComment::GetGenomeBuildNumber(), CClonePlacementGlyph::GetLabel(), CGC_Replicon::GetMoleculeLabel(), CGC_Replicon::GetMoleculeLocation(), CGC_Replicon::GetMoleculeType(), CCommentItem::GetRefTrackStatus(), CCommentItem::GetStringForBankIt(), CCommentItem::GetStringForRefTrack(), CCommentItem::GetStringForTSA(), CCommentItem::GetStringForWGS(), CConstSageData::GetTag(), CTableImportDataSource::ImportTableParms(), CDockManager::LoadLayout(), MakeCompartments(), CRelation::RelationFromUserObject(), CReorderStructuredComment::reorder_comment_by_rule(), variation_ref::RepackageAssertedSequence(), RestoreModelMethod(), s_ExtractPragma(), s_GetAssemblyInfo(), s_GetModelEvidance(), s_GetStructuredCommentPrefix(), s_PassesFilter(), sGetIntField(), sGetMethodFromModelEvidence(), CSeqEntry_test_on_user::TestOnObj(), CValidError_desc::ValidateStructuredComment(), CGvfWriteRecord::x_AssignAttributeID(), CGff3WriteRecordFeature::x_AssignAttributeModelEvidence(), CGvfWriteRecord::x_AssignAttributeParent(), CGvfWriteRecord::x_AssignAttributeVarType(), CGvfWriteRecord::x_AssignSource(), CGffWriteRecordFeature::x_AssignSource(), CGvfWriteRecord::x_AssignType(), CSeqEntry_on_incnst_user::x_ClassifyFlds(), CBLASTParams::x_FromUserObject(), CClonePlacementGlyph::x_GetCloneEnds(), CUIDataSourceService::x_GetDataSourceFromDescr(), CSeqEntry_on_incnst_user::x_GetStrCommPrefix(), CCommonComponentScorer::x_GetUserCompList(), CBioseq_DISC_BAD_BGPIPE_QUALS::x_HasFieldStrNocase(), CLDBlockJob::x_LoadFtable(), CBamRefSeqInfo::x_LoadRangesCov(), CAlignFilter::x_Query_Op(), CVcfWriter::x_WriteFeatureFilter(), CVcfWriter::x_WriteFeatureInfo(), CVcfWriter::x_WriteFeatureQual(), and CVcfWriter::x_WriteInit().

CConstRef< CUser_field > CUser_object::GetFieldRef ( const string str,
const string delim = "." 
) const
void CUser_object::GetLabel ( string label,
ELabelContent  mode = eContent 
) const

Append a label to label.

The type defaults to content for backward compatibility

Definition at line 516 of file User_object.cpp.

References eBoth, eContent, eType, s_GetUserObjectContent(), and s_GetUserObjectType().

Referenced by s_GetContentLabel().

bool CUser_object::HasField ( const string str,
const string delim = "." 
) const
CUser_object& CUser_object::operator= ( const CUser_object value) [private]

format a user object as a given type.

This returns a user-object that is suitable for containing whatever specifics might be needed

Definition at line 538 of file User_object.cpp.

References AddField(), CUser_object(), eCategory_Experiment, eCategory_Unknown, CUser_object_Base::Reset(), s_exp(), s_expres(), s_ncbi(), CUser_object_Base::SetClass(), CObject_id_Base::SetStr(), and CUser_object_Base::SetType().

format a user object as a given type.

This returns a user-object that is suitable for containing whatever specifics might be needed

Definition at line 561 of file User_object.cpp.

References eExperiment_Sage, eExperiment_Unknown, CUser_object_Base::Reset(), s_ncbi(), s_sage(), CUser_object_Base::SetClass(), CObject_id_Base::SetStr(), and CUser_object_Base::SetType().

CUser_field & CUser_object::SetField ( const string str,
const string delim = ".",
const string obj_subtype = kEmptyStr 
)

Access a named field in this user object.

This is a little sneaky in that it interprets a delimiter for recursion. The 'obj_subtype' parameter is used to set the subtype of a sub-object if a new sub-object needs to be created

Definition at line 137 of file User_object.cpp.

References SetFieldRef().

Referenced by CScoreBuilder::AddTracebacks(), variation_ref::AttachAssertedSequence(), NSNPVariationHelper::ConvertFeat(), CTableImportDataSource::ImportTableParms(), CDemoContigAssemblyApp::Run(), CGBProjectHandle::SaveViewSettings(), CSageData::SetCount(), CSageData::SetField(), CSageData::SetMethod(), and CSageData::SetTag().

CRef< CUser_field > CUser_object::SetFieldRef ( const string str,
const string delim = ".",
const string obj_subtype = kEmptyStr 
)

The documentation for this class was generated from the following files:
Modified on Wed Jul 23 17:23:14 2014 by modify_doxy.py rev. 426318