CXXR (C++ R) API
Public Member Functions | Static Public Member Functions
CXXR::UncachedString Class Reference

String object not held in a cache. More...

#include <UncachedString.h>

Inheritance diagram for CXXR::UncachedString:
Inheritance graph
[legend]
Collaboration diagram for CXXR::UncachedString:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 UncachedString (size_t sz, cetype_t encoding=CE_NATIVE)
 Create an UncachedString object, leaving its contents uninitialized.
 UncachedString (const std::string &str, cetype_t encoding=CE_NATIVE)
 Create an UncachedString object from a std::string.
char * ptr ()
 Provide read-write access to the string.
const char * typeName () const
 Name within R of this type of object.
- Public Member Functions inherited from CXXR::String
char operator[] (unsigned int index) const
 Read-only character access.
const char * c_str () const
 Access as a C-style string.
cetype_t encoding () const
 Character encoding.
bool isASCII () const
 Is this Stringpure ASCII?
bool isNA () const
 Test if 'not available'.
const std::string & stdstring () const
 Access encapsulated std::string.
unsigned int packGPBits () const
 Reproduce the gp bits field used in CR.
- Public Member Functions inherited from CXXR::VectorBase
 VectorBase (SEXPTYPE stype, std::size_t sz)
 VectorBase (const VectorBase &pattern)
 Copy constructor.
const ListVectordimensionNames () const
 Names associated with the rows, columns or other dimensions of an R matrix or array.
const StringVectordimensionNames (unsigned int d) const
 Names associated with a particular dimension of an R matrix or array.
const IntVectordimensions () const
 Dimensions of R matrix or array.
const StringVectornames () const
 Names of vector elements.
void setDimensionNames (ListVector *names)
 Associate names with the rows, columns or other dimensions of an R matrix or array.
void setDimensionNames (unsigned int d, StringVector *names)
 Associate names with a particular dimension of an R matrix or array.
void setDimensions (IntVector *dims)
 Define the dimensions of R matrix or array.
void setNames (StringVector *names)
 Associate names with the elements of a VectorBase.
virtual void setSize (std::size_t new_size)
 Adjust the number of elements in the vector.
std::size_t size () const
 Number of elements in the vector.
VectorBaseclone () const
 Return pointer to a copy of this object.
- Public Member Functions inherited from CXXR::RObject
virtual const PairListattributes () const
 Get object attributes.
virtual void clearAttributes ()
 Remove all attributes.
void copyAttribute (const Symbol *name, const RObject *source)
 Copy an attribute from one RObject to another.
void copyAttributes (const RObject *source, bool copyS4)
 Copy attributes from one RObject to another.
virtual RObjectevaluate (Environment *env)
 Evaluate object in a specified Environment.
virtual RObjectgetAttribute (const Symbol *name) const
 Get the value a particular attribute.
virtual bool hasAttributes () const
 Has this object any attributes?
bool hasClass () const
 Has this object the class attribute?
bool isS4Object () const
 Is this an S4 object?
void maybeTraceMemory (const RObject *src)
 Carry out memory tracing.
void maybeTraceMemory (const RObject *src1, const RObject *src2)
 Carry out memory tracing.
void maybeTraceMemory (const RObject *src1, const RObject *src2, const RObject *src3)
 Carry out memory tracing.
bool memoryTraced () const
 Is copying etc. of this object being traced?
virtual void setAttribute (const Symbol *name, RObject *value)
 Set or remove an attribute.
void setAttributes (const PairList *new_attributes)
 Replace the attributes of an object.
void setMemoryTracing (bool on)
 Enable/disable tracing of copying etc.
void setS4Object (bool on)
 Set the status of this RObject as an S4 object.
SEXPTYPE sexptype () const
 Get an object's SEXPTYPE.
virtual void unpackGPBits (unsigned int gpbits)
 Interpret the gp bits field used in CR.
void detachReferents ()
 Null out all references from this node to other nodes.
void visitReferents (const_visitor *v) const
 Conduct a visitor to the nodes referred to by this one.
- Public Member Functions inherited from CXXR::GCNode
void expose () const
 Record that construction of a node is complete.
bool isExposed () const
 Has this node been exposed to garbage collection?

Static Public Member Functions

static const char * staticTypeName ()
 The name by which this type is known in R.
- Static Public Member Functions inherited from CXXR::String
static Stringblank ()
 Blank string.
static cetype_t GPBits2Encoding (unsigned int gpbits)
 Extract encoding information from CR's gp bits field.
static StringNA ()
 'Not available' string.
static Stringobtain (const std::string &str, cetype_t encoding=CE_NATIVE)
 Get a pointer to a String object.
- Static Public Member Functions inherited from CXXR::VectorBase
template<class V >
static V * resize (const V *pattern, std::size_t new_size)
 Create an extended or shrunken copy of an R vector.
static PairListresizeAttributes (const PairList *attributes, std::size_t new_size)
 Adjust attributes for a resized vector.
- Static Public Member Functions inherited from CXXR::RObject
template<class T >
static T * clone (const T *pattern)
 Return a pointer to a copy of an object.
- Static Public Member Functions inherited from CXXR::GCNode
static void * operator new (size_t bytes)
 Allocate memory.
static void * operator new (size_t, void *where)
 Placement new for GCNode.
static void operator delete (void *p, size_t bytes)
 Deallocate memory.
static bool check ()
 Integrity check.
template<class T >
static T * expose (T *node)
 Record that construction of a node is complete.
static void gc ()
 Initiate a garbage collection.
static void gclite ()
 Lightweight garbage collection.
static void maybeCheckExposed (const GCNode *node)
 Subject to configuration, check that a GCNode is exposed.
static size_t numNodes ()
 Number of GCNode objects in existence.

Detailed Description

String object not held in a cache.

Unlike CachedString objects, at any one time more than one UncachedString with the same text and encoding may exist, and the text and encoding of an UncachedString may duplicate that of a CachedString. Moreover, the content and encoding of an UncachedString may be modified after it has been constructed; however, since the length may not be modified, this is of limited usefulness.

Deprecated:
The use of CachedString objects is to be preferred.

Constructor & Destructor Documentation

CXXR::UncachedString::UncachedString ( size_t  sz,
cetype_t  encoding = CE_NATIVE 
)
inlineexplicit

Create an UncachedString object, leaving its contents uninitialized.

Parameters:
szNumber of elements required. Zero is permissible.
encodingThe encoding of the required CachedString. Only CE_NATIVE, CE_UTF8 or CE_LATIN1 are permitted in this context (checked).
CXXR::UncachedString::UncachedString ( const std::string &  str,
cetype_t  encoding = CE_NATIVE 
)
explicit

Create an UncachedString object from a std::string.

Parameters:
strThe std::string whose text is to be copied into the constructed UncachedString. (Embedded null characters are permissible.)
encodingThe encoding of the required CachedString. Only CE_NATIVE, CE_UTF8 or CE_LATIN1 are permitted in this context (checked).

Member Function Documentation

char* CXXR::UncachedString::ptr ( )
inline

Provide read-write access to the string.

Returns:
A pointer to the start of the string. This is intended for immediate use: in particular it should not be used after any other method has been applied to the UncachedString object, including in particular hash().
static const char* CXXR::UncachedString::staticTypeName ( )
inlinestatic

The name by which this type is known in R.

Returns:
the name by which this type is known in R.

Reimplemented from CXXR::String.

const char* CXXR::UncachedString::typeName ( ) const
virtual

Name within R of this type of object.

Returns:
the name by which this type of object is known within R.

Reimplemented from CXXR::String.


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