SNAP Library 2.2, Developer Reference  2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TExpHelpObj Class Reference

#include <exp.h>

Collaboration diagram for TExpHelpObj:

List of all members.

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

Definition at line 316 of file exp.h.

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

Definition at line 317 of file exp.h.

                                                               :
    Type(_Type), CatNm(_CatNm), HdItem(_HdItem), ArgItemV(_ArgItemV){}

Definition at line 323 of file exp.h.

{}
TExpHelpObj::TExpHelpObj ( TSIn SIn) [inline]

Definition at line 324 of file exp.h.

                        :
    Type(SIn), CatNm(SIn), HdItem(SIn), ArgItemV(SIn){}

Member Function Documentation

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

Definition at line 339 of file exp.h.

                                                     {
    return ArgItemV[ArgItemN];}
int TExpHelpObj::GetArgItems ( ) const [inline]

Definition at line 338 of file exp.h.

{return ArgItemV.Len();}
TStr TExpHelpObj::GetCatNm ( ) const [inline]

Definition at line 336 of file exp.h.

{return CatNm;}

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;
}

Here is the call graph for this function:

Definition at line 337 of file exp.h.

{return HdItem;}
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;}
}

Here is the call graph for this function:

Here is the caller graph for this function:

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]

Definition at line 331 of file exp.h.

References Fail.

{Fail; return *this;}
bool TExpHelpObj::operator== ( const TExpHelpObj ) const [inline]

Definition at line 332 of file exp.h.

References Fail.

{Fail; return false;}
void TExpHelpObj::Save ( TSOut SOut) const [inline]

Definition at line 328 of file exp.h.

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

                               {
    Type.Save(SOut); CatNm.Save(SOut); HdItem.Save(SOut); ArgItemV.Save(SOut);}

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

Definition at line 314 of file exp.h.

Referenced by GetHdArgNmStr().

Definition at line 312 of file exp.h.

Definition at line 309 of file exp.h.

Definition at line 313 of file exp.h.

Referenced by GetHdArgNmStr().

Definition at line 311 of file exp.h.

Referenced by GetHdArgNmStr().


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