SNAP Library 2.3, Developer Reference  2014-06-16 11:58:46
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TExpHelpObj Class Reference

#include <exp.h>

Collaboration diagram for TExpHelpObj:

Public Member Functions

 TExpHelpObj ()
 
 TExpHelpObj (const TExpHelpObjType &_Type, const TStr &_CatNm, const PExpHelpItem &_HdItem, const TExpHelpItemV &_ArgItemV)
 
 ~TExpHelpObj ()
 
 TExpHelpObj (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
TExpHelpObjoperator= (const TExpHelpObj &)
 
bool operator== (const TExpHelpObj &) const
 
TExpHelpObjType GetType () const
 
TStr GetCatNm () const
 
PExpHelpItem GetHdItem () const
 
int GetArgItems () const
 
PExpHelpItem GetArgItem (const int &ArgItemN) const
 
TStr GetHdArgNmStr () const
 

Static Public Member Functions

static PExpHelpObj New (const TExpHelpObjType &Type, const TStr &CatNm, const PExpHelpItem &HdItem, const TExpHelpItemV &ArgItemV=TExpHelpItemV())
 
static PExpHelpObj Load (TSIn &SIn)
 
static TExpHelpObjType GetObjTypeFromStr (const TStr &TypeStr)
 

Private Attributes

TCRef CRef
 
TInt Type
 
TStr CatNm
 
PExpHelpItem HdItem
 
TExpHelpItemV ArgItemV
 

Friends

class TPt< TExpHelpObj >
 

Detailed Description

Definition at line 309 of file exp.h.

Constructor & Destructor Documentation

TExpHelpObj::TExpHelpObj ( )
inline

Definition at line 316 of file exp.h.

316 {}
TExpHelpObj::TExpHelpObj ( const TExpHelpObjType _Type,
const TStr _CatNm,
const PExpHelpItem _HdItem,
const TExpHelpItemV _ArgItemV 
)
inline

Definition at line 317 of file exp.h.

318  :
319  Type(_Type), CatNm(_CatNm), HdItem(_HdItem), ArgItemV(_ArgItemV){}
TExpHelpItemV ArgItemV
Definition: exp.h:314
PExpHelpItem HdItem
Definition: exp.h:313
TStr CatNm
Definition: exp.h:312
TInt Type
Definition: exp.h:311
TExpHelpObj::~TExpHelpObj ( )
inline

Definition at line 323 of file exp.h.

323 {}
TExpHelpObj::TExpHelpObj ( TSIn SIn)
inline

Definition at line 324 of file exp.h.

324  :
325  Type(SIn), CatNm(SIn), HdItem(SIn), ArgItemV(SIn){}
TExpHelpItemV ArgItemV
Definition: exp.h:314
PExpHelpItem HdItem
Definition: exp.h:313
TStr CatNm
Definition: exp.h:312
TInt Type
Definition: exp.h:311

Member Function Documentation

PExpHelpItem TExpHelpObj::GetArgItem ( const int &  ArgItemN) const
inline

Definition at line 339 of file exp.h.

339  {
340  return ArgItemV[ArgItemN];}
TExpHelpItemV ArgItemV
Definition: exp.h:314
int TExpHelpObj::GetArgItems ( ) const
inline

Definition at line 338 of file exp.h.

338 {return ArgItemV.Len();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TExpHelpItemV ArgItemV
Definition: exp.h:314
TStr TExpHelpObj::GetCatNm ( ) const
inline

Definition at line 336 of file exp.h.

336 {return CatNm;}
TStr CatNm
Definition: exp.h:312
TStr TExpHelpObj::GetHdArgNmStr ( ) const

Definition at line 1032 of file exp.cpp.

References ArgItemV, ehotFunc, ehotOp, ehotTempl, ehotVar, Fail, TExpHelpItem::GetNm(), TExpHelpItem::GetTypeStr(), HdItem, TVec< TVal, TSizeTy >::Len(), and Type.

1032  {
1033  TChA ChA;
1034  switch (Type){
1035  case ehotOp: {// operator
1036  TStr OpStr=HdItem->GetNm();
1037  if (ArgItemV.Len()==1){
1038  ChA+=OpStr; ChA+=" "; ChA+=ArgItemV[0]->GetNm();
1039  } else
1040  if (ArgItemV.Len()==2){
1041  ChA+=ArgItemV[0]->GetNm();
1042  ChA+=" "; ChA+=OpStr; ChA+=" ";
1043  ChA+=ArgItemV[1]->GetNm();
1044  } else
1045  if (ArgItemV.Len()==3){
1046  ChA+=ArgItemV[0]->GetNm();
1047  ChA+=" "; ChA+=OpStr; ChA+=" ";
1048  ChA+=ArgItemV[1]->GetNm();
1049  ChA+=" "; ChA+=":"; ChA+=" ";
1050  ChA+=ArgItemV[2]->GetNm();
1051  } else {
1052  Fail;
1053  }
1054  break;}
1055  case ehotVar: // variable
1056  ChA+=HdItem->GetNm(); break;
1057  case ehotFunc: // function
1058  ChA+=HdItem->GetTypeStr(); ChA+=" <- ";
1059  ChA+=HdItem->GetNm();
1060  ChA+="(";
1061  {for (int ArgN=0; ArgN<ArgItemV.Len(); ArgN++){
1062  if (ArgN>0){ChA+=", ";}
1063  ChA+=ArgItemV[ArgN]->GetNm();
1064  }}
1065  ChA+=")";
1066  break;
1067  case ehotTempl: // template
1068  ChA+=HdItem->GetTypeStr(); break;
1069  default: Fail;
1070  }
1071  return ChA;
1072 }
#define Fail
Definition: bd.h:238
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
Definition: exp.h:307
TExpHelpItemV ArgItemV
Definition: exp.h:314
Definition: exp.h:307
PExpHelpItem HdItem
Definition: exp.h:313
Definition: dt.h:201
TStr GetNm() const
Definition: exp.h:299
Definition: exp.h:307
Definition: exp.h:307
TInt Type
Definition: exp.h:311
Definition: dt.h:412
TStr GetTypeStr() const
Definition: exp.h:300

Here is the call graph for this function:

PExpHelpItem TExpHelpObj::GetHdItem ( ) const
inline

Definition at line 337 of file exp.h.

337 {return HdItem;}
PExpHelpItem HdItem
Definition: exp.h:313
TExpHelpObjType TExpHelpObj::GetObjTypeFromStr ( const TStr TypeStr)
static

Definition at line 1074 of file exp.cpp.

References ehotFunc, ehotOp, ehotTempl, ehotUndef, ehotVar, and TExcept::Throw().

Referenced by TExpHelp::LoadXml().

1074  {
1075  if (TypeStr=="Op"){return ehotOp;}
1076  else if (TypeStr=="Var"){return ehotVar;}
1077  else if (TypeStr=="Func"){return ehotFunc;}
1078  else if (TypeStr=="Templ"){return ehotTempl;}
1079  else {TExcept::Throw("Invalid object type.", TypeStr); return ehotUndef;}
1080 }
Definition: exp.h:307
static void Throw(const TStr &MsgStr)
Definition: ut.h:187
Definition: exp.h:307
Definition: exp.h:307
Definition: exp.h:307
Definition: exp.h:307

Here is the call graph for this function:

Here is the caller graph for this function:

TExpHelpObjType TExpHelpObj::GetType ( ) const
inline

Definition at line 335 of file exp.h.

335 {return TExpHelpObjType(int(Type));}
TInt Type
Definition: exp.h:311
TExpHelpObjType
Definition: exp.h:307
static PExpHelpObj TExpHelpObj::Load ( TSIn SIn)
inlinestatic

Definition at line 326 of file exp.h.

326  {
327  return PExpHelpObj(new TExpHelpObj(SIn));}
TExpHelpObj()
Definition: exp.h:316
TPt< TExpHelpObj > PExpHelpObj
Definition: exp.h:309
static PExpHelpObj TExpHelpObj::New ( const TExpHelpObjType Type,
const TStr CatNm,
const PExpHelpItem HdItem,
const TExpHelpItemV ArgItemV = TExpHelpItemV() 
)
inlinestatic

Definition at line 320 of file exp.h.

Referenced by TExpHelp::LoadXml().

321  {
322  return PExpHelpObj(new TExpHelpObj(Type, CatNm, HdItem, ArgItemV));}
TExpHelpObj()
Definition: exp.h:316
TInt Type
Definition: exp.h:311
TPt< TExpHelpObj > PExpHelpObj
Definition: exp.h:309

Here is the caller graph for this function:

TExpHelpObj& TExpHelpObj::operator= ( const TExpHelpObj )
inline

Definition at line 331 of file exp.h.

References Fail.

331 {Fail; return *this;}
#define Fail
Definition: bd.h:238
bool TExpHelpObj::operator== ( const TExpHelpObj ) const
inline

Definition at line 332 of file exp.h.

References Fail.

332 {Fail; return false;}
#define Fail
Definition: bd.h:238
void TExpHelpObj::Save ( TSOut SOut) const
inline

Definition at line 328 of file exp.h.

References TStr::Save(), and TPt< TRec >::Save().

328  {
329  Type.Save(SOut); CatNm.Save(SOut); HdItem.Save(SOut); ArgItemV.Save(SOut);}
void Save(TSOut &SOut) const
Definition: dt.h:1057
void Save(TSOut &SOut) const
Definition: ds.h:885
TExpHelpItemV ArgItemV
Definition: exp.h:314
void Save(TSOut &SOut, const bool &IsSmall=false) const
Definition: dt.h:440
PExpHelpItem HdItem
Definition: exp.h:313
TStr CatNm
Definition: exp.h:312
TInt Type
Definition: exp.h:311
void Save(TSOut &SOut) const
Definition: xmlser.h:16

Here is the call graph for this function:

Friends And Related Function Documentation

friend class TPt< TExpHelpObj >
friend

Definition at line 309 of file exp.h.

Member Data Documentation

TExpHelpItemV TExpHelpObj::ArgItemV
private

Definition at line 314 of file exp.h.

Referenced by GetHdArgNmStr().

TStr TExpHelpObj::CatNm
private

Definition at line 312 of file exp.h.

TCRef TExpHelpObj::CRef
private

Definition at line 309 of file exp.h.

PExpHelpItem TExpHelpObj::HdItem
private

Definition at line 313 of file exp.h.

Referenced by GetHdArgNmStr().

TInt TExpHelpObj::Type
private

Definition at line 311 of file exp.h.

Referenced by GetHdArgNmStr().


The documentation for this class was generated from the following files: