CUser_object Class Reference

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

Search Toolkit Book for CUser_object

#include <User_object.hpp>

Inheritance diagram for CUser_object:

Inheritance graph
[legend]
Collaboration diagram for CUser_object:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 50 of file User_object.hpp.

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 }
 general category More...
enum  EExperiment { eExperiment_Unknown = -1, eExperiment_Sage }
 sub-category experiment 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, 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.

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)


Member Typedef Documentation

typedef CUser_object_Base CUser_object::Tparent [private]
 

Reimplemented from CUser_object_Base.

Definition at line 52 of file User_object.hpp.


Member Enumeration Documentation

enum CUser_object::ECategory
 

general category

Enumerator:
eCategory_Unknown 
eCategory_Experiment 

Definition at line 123 of file User_object.hpp.

enum CUser_object::EExperiment
 

sub-category experiment

Enumerator:
eExperiment_Unknown 
eExperiment_Sage 

Definition at line 129 of file User_object.hpp.

enum CUser_object::ELabelContent
 

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

Enumerator:
eType 
eContent 
eBoth 

Definition at line 108 of file User_object.hpp.

enum CUser_object::EParseField
 

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 162 of file User_object.hpp.

Referenced by SetCategory().

CUser_object::~CUser_object void   ) 
 

destructor

Definition at line 54 of file User_object.cpp.

CUser_object::CUser_object const CUser_object value  )  [private]
 

Prohibit copy constructor and assignment operator.


Member Function Documentation

CUser_object & CUser_object::AddField const string &  label,
const vector< CRef< CUser_field > > &  value
 

Definition at line 312 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
const vector< CRef< CUser_object > > &  value
 

Definition at line 299 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
CUser_object value
 

Definition at line 247 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
const vector< double > &  value
 

Definition at line 285 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
const vector< int > &  value
 

Definition at line 272 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
const vector< string > &  value
 

Definition at line 259 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
bool  value
 

Definition at line 234 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
double  value
 

Definition at line 222 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
int  value
 

Definition at line 210 of file User_object.cpp.

References CUser_object_Base::SetData().

CUser_object & CUser_object::AddField const string &  label,
const string &  value,
EParseField  parse = eParse_String
 

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

Definition at line 174 of file User_object.cpp.

References eParse_Number, eParse_String, CUser_object_Base::SetData(), NStr::StringToDouble(), and NStr::StringToInt().

Referenced by SetCategory(), sRectToFields(), and CUIDataSourceService::x_GetDataSourceDescr().

CUser_object::ECategory CUser_object::GetCategory void   )  const
 

accessors: classify a given user object

Definition at line 336 of file User_object.cpp.

References NStr::CompareNocase(), eCategory_Experiment, eCategory_Unknown, CUser_object_Base::GetClass(), CUser_field_Base::GetData(), CUser_object_Base::GetData(), CUser_field_Base::GetLabel(), CUser_object_Base::GetType(), CUser_object_Base::IsSetClass(), CUser_field_Base::IsSetLabel(), ITERATE, s_exp(), s_expres(), s_ncbi(), and size.

Referenced by GetExperimentType(), s_GetUserObjectContent(), and s_GetUserObjectType().

const CUser_object & CUser_object::GetExperiment void   )  const
 

Definition at line 399 of file User_object.cpp.

References eExperiment_Sage, eExperiment_Unknown, CUser_object_Base::GetData(), and GetExperimentType().

CUser_object::EExperiment CUser_object::GetExperimentType void   )  const
 

sub-category accessors:

Definition at line 375 of file User_object.cpp.

References NStr::CompareNocase(), eCategory_Experiment, eExperiment_Sage, eExperiment_Unknown, GetCategory(), CUser_field_Base::GetData(), CUser_object_Base::GetData(), CUser_object_Base::GetType(), and s_sage().

Referenced by GetExperiment(), s_GetUserObjectContent(), and s_GetUserObjectType().

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 63 of file User_object.cpp.

References GetFieldRef().

Referenced by CClonePlacementGlyph::GetTooltip(), RestoreModelMethod(), s_GetEncodeValues(), s_PassesFilter(), sGetIntField(), CClonePlacementGlyph::x_Draw(), CSnpTableJob::x_FetchAll(), and CLDBlockJob::x_LoadFtable().

CConstRef< CUser_field > CUser_object::GetFieldRef const string &  str,
const string &  delim = "."
const
 

step 1: scan one level deep for a nested object we scan only with the first token

Definition at line 70 of file User_object.cpp.

References NStr::Split().

Referenced by GetField(), HasField(), and CSnpFilterJob::Run().

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 503 of file User_object.cpp.

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

bool CUser_object::HasField const string &  str,
const string &  delim = "."
const
 

Verify that a named field exists.

Definition at line 119 of file User_object.cpp.

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

Referenced by CCommentItem::GetRefTrackStatus(), CClonePlacementGlyph::GetTooltip(), and RestoreModelMethod().

CUser_object& CUser_object::operator= const CUser_object value  )  [private]
 

CUser_object & CUser_object::SetCategory ECategory  category  ) 
 

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 525 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(), and CUser_object_Base::SetType().

CUser_object & CUser_object::SetExperiment EExperiment  category  ) 
 

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 548 of file User_object.cpp.

References eExperiment_Sage, eExperiment_Unknown, CUser_object_Base::Reset(), s_ncbi(), s_sage(), CUser_object_Base::SetClass(), 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 130 of file User_object.cpp.

References SetFieldRef().

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

pass 1: see if we have a field that starts with this label already

Definition at line 138 of file User_object.cpp.

References CUser_field_Base::GetLabel(), NON_CONST_ITERATE, CUser_object_Base::SetData(), and NStr::Split().

Referenced by SetField().


The documentation for this class was generated from the following files:
Generated on Mon Dec 7 15:14:30 2009 for NCBI C++ ToolKit by  doxygen 1.4.6
Modified on Mon Dec 07 16:24:19 2009 by modify_doxy.py rev. 173732