Pol  Revision:3cfda13
Pol::Bscript::BDictionary Class Reference

#include <dict.h>

+ Inheritance diagram for Pol::Bscript::BDictionary:

Public Types

typedef std::map< BObject, BObjectRefContents
 
- Public Types inherited from Pol::Bscript::BObjectImp
enum  BObjectType : u8 {
  OTUnknown = 0, OTUninit = 1, OTString = 2, OTLong = 3,
  OTDouble = 4, OTArray = 5, OTApplicPtr = 6, OTApplicObj = 7,
  OTError = 8, OTDictionary = 9, OTStruct = 10, OTPacket = 11,
  OTBinaryFile = 12, OTXMLFile = 13, OTXMLNode = 14, OTXMLAttributes = 15,
  OTPolCoreRef = 16, OTAccountRef = 17, OTConfigFileRef = 18, OTConfigElemRef = 19,
  OTDataFileRef = 20, OTDataElemRef = 21, OTGuildRef = 22, OTPartyRef = 23,
  OTBoundingBox = 24, OTDebugContext = 25, OTScriptExRef = 26, OTPackage = 27,
  OTMenuRef = 28, OTMobileRef = 29, OTOfflineMobileRef = 30, OTItemRef = 31,
  OTBoatRef = 32, OTMultiRef = 33, OTClientRef = 34, OTSQLConnection = 35,
  OTSQLResultSet = 36, OTSQLRow = 37, OTBoolean = 38, OTFuncRef = 39
}
 

Public Member Functions

 BDictionary ()
 
void addMember (const char *name, BObjectRef val)
 
void addMember (const char *name, BObjectImp *imp)
 
void addMember (BObjectImp *key, BObjectImp *val)
 
const Contentscontents () const
 
size_t mapcount () const
 
- Public Member Functions inherited from Pol::Bscript::BObjectImp
 BObjectImp (BObjectType type)
 
virtual ~BObjectImp ()
 
virtual BObjectImpbitnot () const
 
virtual long contains (const BObjectImp &objimp) const
 
virtual BObjectRef get_member_id (const int id)
 
virtual std::string getFormattedStringRep () const
 
unsigned int instance () const
 
virtual BObjectImpinverse () const
 
bool isa (BObjectType type) const
 
virtual bool isTrue () const
 
virtual char member (const BObject &obj) const
 
virtual bool operator!= (const BObjectImp &objimp) const
 
virtual BObject operator- () const
 
virtual bool operator< (const BObjectImp &objimp) const
 
virtual bool operator<= (const BObjectImp &objimp) const
 
virtual bool operator== (const BObjectImp &objimp) const
 
virtual bool operator> (const BObjectImp &objimp) const
 
virtual bool operator>= (const BObjectImp &objimp) const
 
virtual void operDivideEqual (BObject &obj, BObjectImp &objimp)
 
virtual BObjectRef operDotMinus (const char *name)
 
virtual BObjectRef operDotQMark (const char *name)
 
virtual void operInsertInto (BObject &obj, const BObjectImp &objimp)
 
virtual void operMinusEqual (BObject &obj, BObjectImp &objimp)
 
virtual void operModulusEqual (BObject &obj, BObjectImp &objimp)
 
virtual BObjectRef OperMultiSubscript (std::stack< BObjectRef > &indices)
 
virtual BObjectRef OperMultiSubscriptAssign (std::stack< BObjectRef > &indices, BObjectImp *target)
 
virtual void operPlusEqual (BObject &obj, BObjectImp &objimp)
 
virtual void operTimesEqual (BObject &obj, BObjectImp &objimp)
 
virtual std::string pack () const
 
virtual void printOn (std::ostream &) const
 
virtual BObjectImpselfBitAndObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitAndObj (const BLong &objimp) const
 
virtual BObjectImpselfBitAndObj (const Double &objimp) const
 
virtual BObjectImpselfBitAndObj (const String &objimp) const
 
virtual BObjectImpselfBitAndObj (const ObjArray &objimp) const
 
virtual void selfBitAndObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitAndObj (BLong &objimp, BObject &obj)
 
virtual void selfBitAndObj (Double &objimp, BObject &obj)
 
virtual void selfBitAndObj (String &objimp, BObject &obj)
 
virtual void selfBitAndObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitAndObjImp (const BObjectImp &objimp) const
 
virtual void selfBitAndObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitOrObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitOrObj (const BLong &objimp) const
 
virtual BObjectImpselfBitOrObj (const Double &objimp) const
 
virtual BObjectImpselfBitOrObj (const String &objimp) const
 
virtual BObjectImpselfBitOrObj (const ObjArray &objimp) const
 
virtual void selfBitOrObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitOrObj (BLong &objimp, BObject &obj)
 
virtual void selfBitOrObj (Double &objimp, BObject &obj)
 
virtual void selfBitOrObj (String &objimp, BObject &obj)
 
virtual void selfBitOrObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitOrObjImp (const BObjectImp &objimp) const
 
virtual void selfBitOrObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftLeftObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const BLong &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const Double &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const String &objimp) const
 
virtual BObjectImpselfBitShiftLeftObj (const ObjArray &objimp) const
 
virtual void selfBitShiftLeftObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (BLong &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (Double &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (String &objimp, BObject &obj)
 
virtual void selfBitShiftLeftObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftLeftObjImp (const BObjectImp &objimp) const
 
virtual void selfBitShiftLeftObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftRightObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const BLong &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const Double &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const String &objimp) const
 
virtual BObjectImpselfBitShiftRightObj (const ObjArray &objimp) const
 
virtual void selfBitShiftRightObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (BLong &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (Double &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (String &objimp, BObject &obj)
 
virtual void selfBitShiftRightObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitShiftRightObjImp (const BObjectImp &objimp) const
 
virtual void selfBitShiftRightObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfBitXorObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfBitXorObj (const BLong &objimp) const
 
virtual BObjectImpselfBitXorObj (const Double &objimp) const
 
virtual BObjectImpselfBitXorObj (const String &objimp) const
 
virtual BObjectImpselfBitXorObj (const ObjArray &objimp) const
 
virtual void selfBitXorObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfBitXorObj (BLong &objimp, BObject &obj)
 
virtual void selfBitXorObj (Double &objimp, BObject &obj)
 
virtual void selfBitXorObj (String &objimp, BObject &obj)
 
virtual void selfBitXorObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfBitXorObjImp (const BObjectImp &objimp) const
 
virtual void selfBitXorObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfDividedByObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfDividedByObj (const BLong &objimp) const
 
virtual BObjectImpselfDividedByObj (const Double &objimp) const
 
virtual BObjectImpselfDividedByObj (const String &objimp) const
 
virtual BObjectImpselfDividedByObj (const ObjArray &objimp) const
 
virtual void selfDividedByObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfDividedByObj (BLong &objimp, BObject &obj)
 
virtual void selfDividedByObj (Double &objimp, BObject &obj)
 
virtual void selfDividedByObj (String &objimp, BObject &obj)
 
virtual void selfDividedByObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfDividedByObjImp (const BObjectImp &objimp) const
 
virtual void selfDividedByObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfMinusObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfMinusObj (const BLong &objimp) const
 
virtual BObjectImpselfMinusObj (const Double &objimp) const
 
virtual BObjectImpselfMinusObj (const String &objimp) const
 
virtual BObjectImpselfMinusObj (const ObjArray &objimp) const
 
virtual void selfMinusObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfMinusObj (BLong &objimp, BObject &obj)
 
virtual void selfMinusObj (Double &objimp, BObject &obj)
 
virtual void selfMinusObj (String &objimp, BObject &obj)
 
virtual void selfMinusObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfMinusObjImp (const BObjectImp &objimp) const
 
virtual void selfMinusObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfModulusObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfModulusObj (const BLong &objimp) const
 
virtual BObjectImpselfModulusObj (const Double &objimp) const
 
virtual BObjectImpselfModulusObj (const String &objimp) const
 
virtual BObjectImpselfModulusObj (const ObjArray &objimp) const
 
virtual void selfModulusObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfModulusObj (BLong &objimp, BObject &obj)
 
virtual void selfModulusObj (Double &objimp, BObject &obj)
 
virtual void selfModulusObj (String &objimp, BObject &obj)
 
virtual void selfModulusObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfModulusObjImp (const BObjectImp &objimp) const
 
virtual void selfModulusObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfPlusObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfPlusObj (const BLong &objimp) const
 
virtual BObjectImpselfPlusObj (const Double &objimp) const
 
virtual BObjectImpselfPlusObj (const String &objimp) const
 
virtual BObjectImpselfPlusObj (const ObjArray &objimp) const
 
virtual void selfPlusObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfPlusObj (BLong &objimp, BObject &obj)
 
virtual void selfPlusObj (Double &objimp, BObject &obj)
 
virtual void selfPlusObj (String &objimp, BObject &obj)
 
virtual void selfPlusObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfPlusObjImp (const BObjectImp &objimp) const
 
virtual void selfPlusObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectImpselfTimesObj (const BObjectImp &objimp) const
 
virtual BObjectImpselfTimesObj (const BLong &objimp) const
 
virtual BObjectImpselfTimesObj (const Double &objimp) const
 
virtual BObjectImpselfTimesObj (const String &objimp) const
 
virtual BObjectImpselfTimesObj (const ObjArray &objimp) const
 
virtual void selfTimesObj (BObjectImp &objimp, BObject &obj)
 
virtual void selfTimesObj (BLong &objimp, BObject &obj)
 
virtual void selfTimesObj (Double &objimp, BObject &obj)
 
virtual void selfTimesObj (String &objimp, BObject &obj)
 
virtual void selfTimesObj (ObjArray &objimp, BObject &obj)
 
virtual BObjectImpselfTimesObjImp (const BObjectImp &objimp) const
 
virtual void selfTimesObjImp (BObjectImp &objimp, BObject &obj)
 
virtual BObjectRef set_member_id (const int id, BObjectImp *valueimp, bool copy)
 
virtual char str_member (const std::string &membername) const
 
BObjectType type () const
 
- Public Member Functions inherited from ref_counted
unsigned int add_ref ()
 
unsigned int count () const
 
unsigned int release ()
 

Static Public Member Functions

static BObjectImpunpack (std::istream &is)
 
- Static Public Member Functions inherited from Pol::Bscript::BObjectImp
static const char * typestr (BObjectType typ)
 
static BObjectImpunpack (const char *pstr)
 
static BObjectImpunpack (std::istream &is)
 

Protected Member Functions

 BDictionary (std::istream &is, unsigned size, BObjectType type=OTDictionary)
 
 BDictionary (const BDictionary &, BObjectType type=OTDictionary)
 
 BDictionary (BObjectType type)
 
virtual BObjectImparray_assign (BObjectImp *idx, BObjectImp *target, bool copy) POL_OVERRIDE
 
virtual BObjectImpcall_method (const char *methodname, Executor &ex) POL_OVERRIDE
 
virtual BObjectImpcall_method_id (const int id, Executor &ex, bool forcebuiltin=false) POL_OVERRIDE
 
virtual BObjectImpcopy () const POL_OVERRIDE
 
virtual ContIteratorcreateIterator (BObject *pIterVal) POL_OVERRIDE
 
virtual void FormatForStringRep (std::ostream &os, const BObject &bkeyobj, const BObjectRef &bvalref) const
 
virtual BObjectRef get_member (const char *membername) POL_OVERRIDE
 
virtual std::string getStringRep () const POL_OVERRIDE
 
virtual BObjectRef operDotPlus (const char *name) POL_OVERRIDE
 
virtual BObjectRef OperSubscript (const BObject &obj) POL_OVERRIDE
 
virtual void packonto (std::ostream &os) const POL_OVERRIDE
 
virtual char packtype () const
 
virtual BObjectRef set_member (const char *membername, BObjectImp *value, bool copy) POL_OVERRIDE
 
virtual size_t sizeEstimate () const POL_OVERRIDE
 
virtual const char * typeOf () const POL_OVERRIDE
 
virtual u8 typeOfInt () const POL_OVERRIDE
 
virtual const char * typetag () const
 
- Protected Member Functions inherited from ref_counted
 ref_counted ()
 

Private Member Functions

BDictionaryoperator= (const BDictionary &)
 

Private Attributes

Contents contents_
 

Friends

class BDictionaryIterator
 

Additional Inherited Members

- Protected Attributes inherited from ref_counted
std::atomic< unsigned int > _count
 

Detailed Description

Definition at line 35 of file dict.h.

Member Typedef Documentation

Definition at line 47 of file dict.h.

Constructor & Destructor Documentation

Pol::Bscript::BDictionary::BDictionary ( )

Definition at line 25 of file dict.cpp.

Pol::Bscript::BDictionary::BDictionary ( std::istream &  is,
unsigned  size,
BObjectType  type = OTDictionary 
)
protected

Definition at line 41 of file dict.cpp.

References contents_, and Pol::Bscript::BObjectImp::unpack().

Pol::Bscript::BDictionary::BDictionary ( const BDictionary dict,
BObjectType  type = OTDictionary 
)
protected

Definition at line 29 of file dict.cpp.

References contents_.

Pol::Bscript::BDictionary::BDictionary ( BObjectType  type)
explicitprotected

Definition at line 27 of file dict.cpp.

Member Function Documentation

void Pol::Bscript::BDictionary::addMember ( const char *  name,
BObjectRef  val 
)
void Pol::Bscript::BDictionary::addMember ( const char *  name,
BObjectImp imp 
)

Definition at line 238 of file dict.cpp.

void Pol::Bscript::BDictionary::addMember ( BObjectImp key,
BObjectImp val 
)

Definition at line 244 of file dict.cpp.

BObjectImp * Pol::Bscript::BDictionary::array_assign ( BObjectImp idx,
BObjectImp target,
bool  copy 
)
protectedvirtual
BObjectImp * Pol::Bscript::BDictionary::call_method ( const char *  methodname,
Executor ex 
)
protectedvirtual
const BDictionary::Contents & Pol::Bscript::BDictionary::contents ( ) const
BObjectImp * Pol::Bscript::BDictionary::copy ( void  ) const
protectedvirtual

Implements Pol::Bscript::BObjectImp.

Definition at line 125 of file dict.cpp.

ContIterator * Pol::Bscript::BDictionary::createIterator ( BObject pIterVal)
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 120 of file dict.cpp.

References Pol::Bscript::BDictionaryIterator::BDictionaryIterator().

void Pol::Bscript::BDictionary::FormatForStringRep ( std::ostream &  os,
const BObject bkeyobj,
const BObjectRef bvalref 
) const
protectedvirtual
BObjectRef Pol::Bscript::BDictionary::get_member ( const char *  membername)
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 167 of file dict.cpp.

References Pol::Bscript::UninitObject::create().

std::string Pol::Bscript::BDictionary::getStringRep ( ) const
protectedvirtual

Implements Pol::Bscript::BObjectImp.

Definition at line 388 of file dict.cpp.

References OSTRINGSTREAM, and OSTRINGSTREAM_STR.

size_t Pol::Bscript::BDictionary::mapcount ( ) const

Definition at line 142 of file dict.cpp.

BDictionary& Pol::Bscript::BDictionary::operator= ( const BDictionary )
private
BObjectRef Pol::Bscript::BDictionary::operDotPlus ( const char *  name)
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 420 of file dict.cpp.

void Pol::Bscript::BDictionary::packonto ( std::ostream &  os) const
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 354 of file dict.cpp.

References Pol::Bscript::BObject::impref(), and Pol::Bscript::BObjectImp::packonto().

char Pol::Bscript::BDictionary::packtype ( ) const
protectedvirtual

Definition at line 335 of file dict.cpp.

BObjectRef Pol::Bscript::BDictionary::set_member ( const char *  membername,
BObjectImp value,
bool  copy 
)
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 147 of file dict.cpp.

References Pol::Bscript::BObjectImp::copy().

size_t Pol::Bscript::BDictionary::sizeEstimate ( ) const
protectedvirtual
const char * Pol::Bscript::BDictionary::typeOf ( ) const
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 345 of file dict.cpp.

u8 Pol::Bscript::BDictionary::typeOfInt ( ) const
protectedvirtual

Reimplemented from Pol::Bscript::BObjectImp.

Definition at line 349 of file dict.cpp.

References Pol::Bscript::BObjectImp::OTDictionary.

const char * Pol::Bscript::BDictionary::typetag ( ) const
protectedvirtual

Definition at line 340 of file dict.cpp.

BObjectImp * Pol::Bscript::BDictionary::unpack ( std::istream &  is)
static

Definition at line 368 of file dict.cpp.

Referenced by Pol::Bscript::BObjectImp::unpack().

Friends And Related Function Documentation

friend class BDictionaryIterator
friend

Definition at line 78 of file dict.h.

Member Data Documentation

Contents Pol::Bscript::BDictionary::contents_
private

Definition at line 84 of file dict.h.

Referenced by BDictionary(), and Pol::Bscript::BDictionaryIterator::step().


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