Codemesh Runtime v3 C++ API Reference  3.9.205
Public Member Functions | List of all members
xmog_char Class Reference

A wrapper type for character proxies. This type wraps the Java char type in a proxy type that uses the JNI jchar type to repesent the Java type. Conversion operators allow convenient usage while the get/set methods take an optional xmog_localenv argument for better performance (by saving at least a threadlocal memory access). More...

#include <xmog_java_field.h>

Inheritance diagram for xmog_char:
Inheritance graph
[legend]
Collaboration diagram for xmog_char:
Collaboration graph
[legend]

Public Member Functions

 xmog_char (xmog_java_array *_ref, jint _index)
 Creates an instance that acts as a proxy for an element of a char array. More...
 
 xmog_char (xmog_java_ref *_clazz_ref_array, xmog_java_dynamic *_dynamic, xmog_flags _flags=0)
 Creates an instance that acts as a proxy for an indirect element of char type. More...
 
 operator int () const
 A conversion operator to the int type. More...
 
int operator* () const
 The dereference operator converts to the int type. More...
 
xmog_charoperator= (int)
 An assignment operator from the char type. More...
 
xmog_charoperator|= (int)
 The bitwise-OR assignment operator from the int type. More...
 
xmog_charoperator&= (int)
 The bitwise-AND assignment operator from the int type. More...
 
xmog_charoperator^= (int)
 The bitwise-XOR assignment operator from the int type. More...
 
xmog_charoperator++ ()
 The pre-increment operator from the jchar type. More...
 
xmog_charoperator-- ()
 The pre-decrement operator from the jchar type. More...
 
jchar operator++ (int)
 The post-increment operator from the jchar type. More...
 
jchar operator-- (int)
 The post-decrement operator from the jchar type. More...
 
xmog_charoperator+= (int)
 The additive assignment operator from the int type. More...
 
xmog_charoperator-= (int)
 The subtractive assignment operator from the int type. More...
 
xmog_charoperator*= (int)
 The multiplicative assignment operator from the int type. More...
 
xmog_charoperator/= (int)
 The divisive assignment operator from the int type. More...
 
xmog_charoperator%= (int)
 The modulo assignment operator from the jchar type. More...
 
xmog_charoperator<<= (int)
 The left shift assignment operator from the jchar type. More...
 
xmog_charoperator>>= (int)
 The right shift assignment operator from the jchar type. More...
 
int get (xmog_localenv *env=NULL, bool readThrough=false) const
 Returns the value of a char proxy instance. More...
 
void set (int c, xmog_localenv *env=NULL, bool writeThrough=false)
 Sets the value of a char proxy. More...
 
- Public Member Functions inherited from xmog_base
 xmog_base ()
 The default contructor. More...
 
 xmog_base (xmog_java_array *_ref, jint _index)
 The constructor for Java array elements. More...
 
 xmog_base (xmog_java_ref *_ref, xmog_java_dynamic *_dynamic, xmog_flags _flags)
 The constructor for indirect and user-defined types. More...
 
 xmog_base (xmog_java_class *_clazz, xmog_java_dynamic *_dynamic, xmog_flags _flags)
 The constructor for indirect and user-defined types. More...
 
XMOG_EXPLICIT xmog_base (xmog_base *_delegate, bool _owns_delegate=true)
 The constructor for delegating objects. More...
 
 xmog_base (jobject _local, xmog_flags _flags)
 The constructor for direct types. More...
 
virtual ~xmog_base ()
 The virtual destructor.
 
virtual void copy_jobject_ (xmog_base *_rhs, xmog_localenv *env=NULL)
 Sets this instance's object reference to a duplicate of the given object's reference. More...
 
virtual jobject get_owning_jobject_ (xmog_localenv *env=NULL)
 Returns this instance's owner. More...
 
virtual jobject get_jobject_ (xmog_localenv *env=NULL) const
 Returns this instance's object reference. More...
 
virtual jobject get_released_local_jobject_ (xmog_localenv *env=NULL) const
 Returns this instance's object reference as a local reference and removes it from this instance's ownership. More...
 
virtual bool is_null_ (xmog_localenv *env=NULL) const
 Tests the instance for null.
 
virtual bool is_same_ (const xmog_base &_rhs, xmog_localenv *env=NULL) const
 Tests whether this instance references the same instance as the other instance.
 
virtual jobject duplicate_jobject_ (xmog_localenv *env=NULL) const
 Returns a duplicate of this instance's object reference. More...
 
virtual void set_jobject_ (xmog_base *_rhs, xmog_localenv *env=NULL)
 Sets this instance's object reference to the given object's reference. More...
 
virtual void transfer_jobject_ (xmog_base *_rhs, xmog_localenv *env=NULL)
 Sets this instance's object reference to the given object's reference and removes ownership from the other object. More...
 
virtual xmog_basexmog_to_ (xmog_flags flags, xmog_localenv *env=NULL)
 Converts a reference from one reference type to another. More...
 
virtual xmog_basexmog_fill_with_standalone_for_ (xmog_base *_rhs, xmog_localenv *env=NULL)
 Populates the object with a stand-alone reference based on another object. More...
 
virtual xmog_java_classxmog_get_java_peer (xmog_localenv *env=NULL)
 Returns NULL if the type does not have a Java peer type, a pointer to the type's xmog_java_class otherwise. More...
 
virtual int xmog_create_java_peer (xmog_java_class *clazz, xmog_localenv *env=NULL, xmog_flags flags=xmog_base::GLOBAL)
 Creates a Java peer instance for this type.
More...
 
virtual int xmog_to_java_peer (xmog_localenv *env=NULL)
 Sets the native instance's state into the Java peer instance. More...
 
virtual void xmog_lazy_write (xmog_localenv *env=NULL)
 Performs a lazy write operation on the instance. More...
 
virtual void xmog_invalidate (xmog_localenv *env=NULL)
 Invalidates any cached values in the instance. More...
 
void release_standalone (xmog_localenv *env=NULL)
 Releases the internally maintained object if the instance is a stand-alone (direct) instance and not an indirect instance. More...
 
void release_delegate ()
 Releases the internally maintained delegate.
 

Additional Inherited Members

- Public Types inherited from xmog_base
enum  flags {
  STAND_ALONE = 1, ARRAY_ELEMENT = 2, DYNAMIC = 4, DELEGATE = 8,
  LOCAL = 16, WEAK_GLOBAL = 32, GLOBAL = 64, REMOTE = 128,
  CACHING = 256, CACHE_INVALID = 512, CACHE_DIRTY = 1024, CACHE_LAZY_WRITE = 2048,
  OWNS_DELEGATE = 4096, STRING_DIRTY = 8192, STRING_PTR = 16384, STRING_WPTR = 32768,
  INDIRECT = 65536, NONVIRT = 131072, SUPPRESS_LOGGING = 262144, CATEGORY = 15,
  TYPE = 240, CACHE = 3840
}
 The possible flag values. More...
 
- Public Attributes inherited from xmog_base
XMOG_JOBJECT_HOLDER owner_
 The owner or identity of the object. More...
 
union {
   xmog_java_dynamic *   dynamic_
 A pointer to an object that can access indirectly specified information.
 
   jint   index_
 The index of an array element.
 
}; 
 Data or object that provides assistance in accessing indirectly specified elements. More...
 
xmog_flags flags_
 The flags governing the type and other housekeeping information.
 

Detailed Description

A wrapper type for character proxies. This type wraps the Java char type in a proxy type that uses the JNI jchar type to repesent the Java type. Conversion operators allow convenient usage while the get/set methods take an optional xmog_localenv argument for better performance (by saving at least a threadlocal memory access).

Constructor & Destructor Documentation

◆ xmog_char() [1/2]

xmog_char::xmog_char ( xmog_java_array _ref,
jint  _index 
)

Creates an instance that acts as a proxy for an element of a char array.

Parameters
_refa pointer to an array proxy element.
_indexthe index of the element.

◆ xmog_char() [2/2]

xmog_char::xmog_char ( xmog_java_ref _clazz_ref_array,
xmog_java_dynamic _dynamic,
xmog_flags  _flags = 0 
)

Creates an instance that acts as a proxy for an indirect element of char type.

Parameters
_clazz_ref_arraya pointer to the owner of the primitive value.
_dynamicthe algorithm to access the value.
_flagsadditional processing arguments.

Member Function Documentation

◆ get()

int xmog_char::get ( xmog_localenv env = NULL,
bool  readThrough = false 
) const

Returns the value of a char proxy instance.

This method takes two optional arguments that can be used to improve overall performance or force a read from the Java side even if a cached value is available.

Parameters
enva local environment pointer. May be NULL.
readThroughtrue if the value should be read from the Java side unconditionally, false if a cached value should be used if available. This flag is ignored if the instance does not use caching or if it does not yet have a cached value.

◆ operator int()

xmog_char::operator int ( ) const

A conversion operator to the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive char or int rhs-value. This class has a conversion operator to int rather than jchar to be compatible with the C-runtime library functions that deal with characters.

You can achieve better performance by using the get(xmog_localenv*,bool) method with the proper arguments.

◆ operator%=()

xmog_char& xmog_char::operator%= ( int  )

The modulo assignment operator from the jchar type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jchar,xmog_localenv*,bool) method with the proper arguments.

◆ operator&=()

xmog_char& xmog_char::operator&= ( int  )

The bitwise-AND assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ operator*()

int xmog_char::operator* ( ) const

The dereference operator converts to the int type.

This operator is declared to support array iterators.

◆ operator*=()

xmog_char& xmog_char::operator*= ( int  )

The multiplicative assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ operator++() [1/2]

xmog_char& xmog_char::operator++ ( )

The pre-increment operator from the jchar type.

Since
3.9

◆ operator++() [2/2]

jchar xmog_char::operator++ ( int  )

The post-increment operator from the jchar type.

Since
3.9

◆ operator+=()

xmog_char& xmog_char::operator+= ( int  )

The additive assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ operator--() [1/2]

xmog_char& xmog_char::operator-- ( )

The pre-decrement operator from the jchar type.

Since
3.9

◆ operator--() [2/2]

jchar xmog_char::operator-- ( int  )

The post-decrement operator from the jchar type.

Since
3.9

◆ operator-=()

xmog_char& xmog_char::operator-= ( int  )

The subtractive assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ operator/=()

xmog_char& xmog_char::operator/= ( int  )

The divisive assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ operator<<=()

xmog_char& xmog_char::operator<<= ( int  )

The left shift assignment operator from the jchar type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jchar,xmog_localenv*,bool) method with the proper arguments.

◆ operator=()

xmog_char& xmog_char::operator= ( int  )

An assignment operator from the char type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive char lhs-value. You can achieve better performance by using the set(int,xmog_localenv*,bool) method with the proper arguments.

◆ operator>>=()

xmog_char& xmog_char::operator>>= ( int  )

The right shift assignment operator from the jchar type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jchar,xmog_localenv*,bool) method with the proper arguments.

◆ operator^=()

xmog_char& xmog_char::operator^= ( int  )

The bitwise-XOR assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ operator|=()

xmog_char& xmog_char::operator|= ( int  )

The bitwise-OR assignment operator from the int type.

This operator allows the use of proxy instances of this type in any place where the compiler expects a primitive jchar lhs-value. You can achieve better performance by using the set(jbyte,xmog_localenv*,bool) method with the proper arguments.

◆ set()

void xmog_char::set ( int  c,
xmog_localenv env = NULL,
bool  writeThrough = false 
)

Sets the value of a char proxy.

This method takes two optional arguments that can be used to improve overall performance or force a write to the Java side even if the CACHE_LAZY_WRITE policy is in effect for this instance.

Parameters
cthe new value.
enva local environment pointer. May be NULL.
writeThroughtrue if the value should be written to the Java side unconditionally, false if only the cached value should be updated. This flag is ignored if the instance does not use caching.

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

Copyright (c) 1999-2020 by Codemesh, Inc., ALL RIGHTS RESERVED.