|
SNAP Library 2.1, Developer Reference
2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <exp.h>

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 |
| TExpHelpObj & | operator= (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 > |
| TExpHelpObj::TExpHelpObj | ( | ) | [inline] |
| TExpHelpObj::TExpHelpObj | ( | const TExpHelpObjType & | _Type, |
| const TStr & | _CatNm, | ||
| const PExpHelpItem & | _HdItem, | ||
| const TExpHelpItemV & | _ArgItemV | ||
| ) | [inline] |
| TExpHelpObj::~TExpHelpObj | ( | ) | [inline] |
| TExpHelpObj::TExpHelpObj | ( | TSIn & | SIn | ) | [inline] |
| PExpHelpItem TExpHelpObj::GetArgItem | ( | const int & | ArgItemN | ) | const [inline] |
| int TExpHelpObj::GetArgItems | ( | ) | const [inline] |
| TStr TExpHelpObj::GetCatNm | ( | ) | const [inline] |
| 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.
{
TChA ChA;
switch (Type){
case ehotOp: {// operator
TStr OpStr=HdItem->GetNm();
if (ArgItemV.Len()==1){
ChA+=OpStr; ChA+=" "; ChA+=ArgItemV[0]->GetNm();
} else
if (ArgItemV.Len()==2){
ChA+=ArgItemV[0]->GetNm();
ChA+=" "; ChA+=OpStr; ChA+=" ";
ChA+=ArgItemV[1]->GetNm();
} else
if (ArgItemV.Len()==3){
ChA+=ArgItemV[0]->GetNm();
ChA+=" "; ChA+=OpStr; ChA+=" ";
ChA+=ArgItemV[1]->GetNm();
ChA+=" "; ChA+=":"; ChA+=" ";
ChA+=ArgItemV[2]->GetNm();
} else {
Fail;
}
break;}
case ehotVar: // variable
ChA+=HdItem->GetNm(); break;
case ehotFunc: // function
ChA+=HdItem->GetTypeStr(); ChA+=" <- ";
ChA+=HdItem->GetNm();
ChA+="(";
{for (int ArgN=0; ArgN<ArgItemV.Len(); ArgN++){
if (ArgN>0){ChA+=", ";}
ChA+=ArgItemV[ArgN]->GetNm();
}}
ChA+=")";
break;
case ehotTempl: // template
ChA+=HdItem->GetTypeStr(); break;
default: Fail;
}
return ChA;
}

| PExpHelpItem TExpHelpObj::GetHdItem | ( | ) | const [inline] |
| 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().
{
if (TypeStr=="Op"){return ehotOp;}
else if (TypeStr=="Var"){return ehotVar;}
else if (TypeStr=="Func"){return ehotFunc;}
else if (TypeStr=="Templ"){return ehotTempl;}
else {TExcept::Throw("Invalid object type.", TypeStr); return ehotUndef;}
}


| TExpHelpObjType TExpHelpObj::GetType | ( | ) | const [inline] |
Definition at line 335 of file exp.h.
{return TExpHelpObjType(int(Type));}
| static PExpHelpObj TExpHelpObj::Load | ( | TSIn & | SIn | ) | [inline, static] |
Definition at line 326 of file exp.h.
{
return PExpHelpObj(new TExpHelpObj(SIn));}
| static PExpHelpObj TExpHelpObj::New | ( | const TExpHelpObjType & | Type, |
| const TStr & | CatNm, | ||
| const PExpHelpItem & | HdItem, | ||
| const TExpHelpItemV & | ArgItemV = TExpHelpItemV() |
||
| ) | [inline, static] |
Definition at line 320 of file exp.h.
{
return PExpHelpObj(new TExpHelpObj(Type, CatNm, HdItem, ArgItemV));}
| TExpHelpObj& TExpHelpObj::operator= | ( | const TExpHelpObj & | ) | [inline] |
| bool TExpHelpObj::operator== | ( | const TExpHelpObj & | ) | const [inline] |
| void TExpHelpObj::Save | ( | TSOut & | SOut | ) | const [inline] |
friend class TPt< TExpHelpObj > [friend] |
TExpHelpItemV TExpHelpObj::ArgItemV [private] |
Definition at line 314 of file exp.h.
Referenced by GetHdArgNmStr().
TStr TExpHelpObj::CatNm [private] |
TCRef TExpHelpObj::CRef [private] |
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().