JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
JStringPtrMap< V > Class Template Reference

#include <JStringPtrMap.h>

Inheritance diagram for JStringPtrMap< V >:
[legend]

Public Member Functions

 JStringPtrMap (const JPtrArrayT::CleanUpAction action, const JSize lgSize=kJDefaultLgMinTableSize)
 
 ~JStringPtrMap () override
 
bool GetItem (const JString &key, V **ptr)
 
bool GetItem (const JString &key, const V **ptr) const
 
bool SetItem (const JString &key, V *ptr, const JPtrArrayT::SetAction action, const JStringMapT::SetType type=JStringMapT::kAlways)
 
bool SetOldItem (const JString &key, V *ptr, const JPtrArrayT::SetAction action)
 
bool SetContains (const JString &key, V *ptr, const JPtrArrayT::SetAction action)
 
bool GetItem (const JUtf8Byte *key, V **ptr)
 
bool GetItem (const JUtf8Byte *key, const V **ptr) const
 
bool SetItem (const JUtf8Byte *key, V *ptr, const JPtrArrayT::SetAction action, const JStringMapT::SetType type=JStringMapT::kAlways)
 
bool SetOldItem (const JUtf8Byte *key, V *ptr, const JPtrArrayT::SetAction action)
 
bool SetContains (const JUtf8Byte *key, V *ptr, const JPtrArrayT::SetAction action)
 
bool SetItem (const JString &key, const V &data, const JPtrArrayT::SetAction action, const JStringMapT::SetType type=JStringMapT::kAlways)
 
bool SetNewItem (const JString &key, const V &data)
 
bool SetOldItem (const JString &key, const V &data, const JPtrArrayT::SetAction action)
 
bool SetContains (const JString &key, const V &data, const JPtrArrayT::SetAction action)
 
bool DeleteItem (const JString &key)
 
bool DeleteItemAsArray (const JString &key)
 
bool SetItem (const JUtf8Byte *key, const V &data, const JPtrArrayT::SetAction action, const JStringMapT::SetType type=JStringMapT::kAlways)
 
bool SetNewItem (const JUtf8Byte *key, const V &data)
 
bool SetOldItem (const JUtf8Byte *key, const V &data, const JPtrArrayT::SetAction action)
 
bool SetContains (const JUtf8Byte *key, const V &data, const JPtrArrayT::SetAction action)
 
bool DeleteItem (const JUtf8Byte *key)
 
bool DeleteItemAsArray (const JUtf8Byte *key)
 
void CleanOut ()
 
void DeleteAll ()
 
void DeleteAllAsArrays ()
 
JPtrArrayT::CleanUpAction GetCleanUpAction () const
 
void SetCleanUpAction (const JPtrArrayT::CleanUpAction action)
 
- Public Member Functions inherited from JStringMap< V * >
 JStringMap (const JSize lgSize=kJDefaultLgMinTableSize)
 
 ~JStringMap () override
 
bool Contains (const JString &key) const
 
bool Contains (const JUtf8Byte *key) const
 
bool GetItem (const JString &key, V * *value) const
 
bool GetItem (const JUtf8Byte *key, V * *value) const
 
bool SetItem (const JString &key, const V * &value, const JStringMapT::SetType type=JStringMapT::kAlways)
 
bool SetItem (const JUtf8Byte *key, const V * &value, const JStringMapT::SetType type=JStringMapT::kAlways)
 
bool SetNewItem (const JString &key, const V * &value)
 
bool SetNewItem (const JUtf8Byte *key, const V * &value)
 
bool SetOldItem (const JString &key, const V * &value)
 
bool SetOldItem (const JUtf8Byte *key, const V * &value)
 
bool SetContains (const JString &key, const V * &value)
 
bool SetContains (const JUtf8Byte *key, const V * &value)
 
bool RemoveItem (const JString &key)
 
bool RemoveItem (const JUtf8Byte *key)
 
void RemoveAll ()
 
- Public Member Functions inherited from JHashTable< V >
 JHashTable (const JSize lgSize=kJDefaultLgMinTableSize)
 
virtual ~JHashTable ()
 
bool IsEmpty () const
 
JSize GetItemCount () const
 
JSize GetLgSize () const
 
JSize GetLoadCount () const
 
JSize GetTableSize () const
 
JFloat GetFillFactor () const
 
JFloat GetLoadFactor () const
 
bool GetResizeEnabled () const
 
void SetResizeEnabled (const bool enabled)
 
JFloat GetMaxLoadFactor () const
 
void SetMaxLoadFactor (const JFloat newMax)
 
JFloat GetMinFillFactor () const
 
void SetMinFillFactor (const JFloat newMin)
 
JSize GetMinTableSize () const
 
void SetMinTableSize (const JSize newMin)
 
bool IsOK () const
 

Protected Member Functions

void PrepareForSet (const JPtrArrayT::SetAction action) override
 
- Protected Member Functions inherited from JStringMap< V * >
bool SetItem (const JString &key, const V * &value, const JPtrArrayT::SetAction action, const JStringMapT::SetType type, bool *existed)
 
bool RemoveItem (const JString &key, const JPtrArrayT::SetAction action)
 
void RemoveAll (const JPtrArrayT::SetAction action)
 
- Protected Member Functions inherited from JHashTable< V >
void AllowCursors ()
 
void DisallowCursors ()
 
JHashCursor< V > * GetCursor ()
 
JConstHashCursor< V > * GetCursor () const
 
const JHashRecord< V > & GetRecord (const JSize index) const
 
JHashRecordT::State GetState (const JSize index) const
 
bool IsEmpty (const JSize index) const
 
bool IsDeleted (const JSize index) const
 
bool IsFull (const JSize index) const
 
JHashValue GetHashValue (const JSize index) const
 
const V & GetValue (const JSize index) const
 
void Set (const JSize index, const JHashRecord< V > &record)
 
void Set (const JSize index, const JHashValue hash, const V &value)
 
void Set (const JSize index, const V &value)
 
void SetHash (const JSize index, const V &value)
 
void Remove (const JSize index)
 
void MarkEmpty (const JSize index)
 
void MarkAllEmpty ()
 
bool TryResizeTable (const JSize lgSize)
 
void ResizeTable (const JSize lgTrialSize)
 
virtual bool FitToLimits (const JSize required=0, const bool force=false)
 
JSize HashToIndex (JHashValue hash) const
 

Friends

class JStringMapCursor< V * >
 

Detailed Description

template<class V>
class JStringPtrMap< V >

Interface for the JStringPtrMap template.

Base code generated by Codemill v0.1.0

Interface for the JStringPtrMapCursor class.

Base code generated by Codemill v0.1.0

Constructor & Destructor Documentation

◆ JStringPtrMap()

template<class V >
JStringPtrMap< V >::JStringPtrMap ( const JPtrArrayT::CleanUpAction  action,
const JSize  lgSize = kJDefaultLgMinTableSize 
)

A convenience for maps which store pointers.

Base code generated by Codemill v0.1.0

◆ ~JStringPtrMap()

template<class V >
JStringPtrMap< V >::~JStringPtrMap ( )
override

Member Function Documentation

◆ CleanOut()

template<class V >
void JStringPtrMap< V >::CleanOut ( )

◆ DeleteAll()

template<class V >
void JStringPtrMap< V >::DeleteAll ( )
inline

◆ DeleteAllAsArrays()

template<class V >
void JStringPtrMap< V >::DeleteAllAsArrays ( )
inline

◆ DeleteItem() [1/2]

template<class V >
bool JStringPtrMap< V >::DeleteItem ( const JString key)
inline

◆ DeleteItem() [2/2]

template<class V >
bool JStringPtrMap< V >::DeleteItem ( const JUtf8Byte key)
inline

◆ DeleteItemAsArray() [1/2]

template<class V >
bool JStringPtrMap< V >::DeleteItemAsArray ( const JString key)
inline

◆ DeleteItemAsArray() [2/2]

template<class V >
bool JStringPtrMap< V >::DeleteItemAsArray ( const JUtf8Byte key)
inline

◆ GetCleanUpAction()

template<class V >
JPtrArrayT::CleanUpAction JStringPtrMap< V >::GetCleanUpAction ( ) const
inline

What to do when the destructor is called. This is especially useful for objects allocated on the stack, because one can set the appropriate action and then never have to worry about short-circuit returns.

◆ GetItem() [1/4]

template<class V >
bool JStringPtrMap< V >::GetItem ( const JString key,
const V **  ptr 
) const
inline

◆ GetItem() [2/4]

template<class V >
bool JStringPtrMap< V >::GetItem ( const JString key,
V **  ptr 
)
inline

◆ GetItem() [3/4]

template<class V >
bool JStringPtrMap< V >::GetItem ( const JUtf8Byte key,
const V **  ptr 
) const
inline

◆ GetItem() [4/4]

template<class V >
bool JStringPtrMap< V >::GetItem ( const JUtf8Byte key,
V **  ptr 
)
inline

These override the version in JStringMap to preserve constness.

◆ PrepareForSet()

template<class V >
void JStringPtrMap< V >::PrepareForSet ( const JPtrArrayT::SetAction  action)
overrideprotectedvirtual

Operates on the cursor's item.

Reimplemented from JStringMap< V * >.

◆ SetCleanUpAction()

template<class V >
void JStringPtrMap< V >::SetCleanUpAction ( const JPtrArrayT::CleanUpAction  action)
inline

◆ SetContains() [1/4]

template<class V >
bool JStringPtrMap< V >::SetContains ( const JString key,
const V &  data,
const JPtrArrayT::SetAction  action 
)

◆ SetContains() [2/4]

template<class V >
bool JStringPtrMap< V >::SetContains ( const JString key,
V *  ptr,
const JPtrArrayT::SetAction  action 
)
inline

◆ SetContains() [3/4]

template<class V >
bool JStringPtrMap< V >::SetContains ( const JUtf8Byte key,
const V &  data,
const JPtrArrayT::SetAction  action 
)

◆ SetContains() [4/4]

template<class V >
bool JStringPtrMap< V >::SetContains ( const JUtf8Byte key,
V *  ptr,
const JPtrArrayT::SetAction  action 
)
inline

◆ SetItem() [1/4]

template<class V >
bool JStringPtrMap< V >::SetItem ( const JString key,
const V &  data,
const JPtrArrayT::SetAction  action,
const JStringMapT::SetType  type = JStringMapT::kAlways 
)

◆ SetItem() [2/4]

template<class V >
bool JStringPtrMap< V >::SetItem ( const JString key,
V *  ptr,
const JPtrArrayT::SetAction  action,
const JStringMapT::SetType  type = JStringMapT::kAlways 
)
inline

◆ SetItem() [3/4]

template<class V >
bool JStringPtrMap< V >::SetItem ( const JUtf8Byte key,
const V &  data,
const JPtrArrayT::SetAction  action,
const JStringMapT::SetType  type = JStringMapT::kAlways 
)

These override the versions in JStringMap to allow you to store a copy of the object.

◆ SetItem() [4/4]

template<class V >
bool JStringPtrMap< V >::SetItem ( const JUtf8Byte key,
V *  ptr,
const JPtrArrayT::SetAction  action,
const JStringMapT::SetType  type = JStringMapT::kAlways 
)
inline

These override the versions in JStringMap to force you to consider the SetAction.

◆ SetNewItem() [1/2]

template<class V >
bool JStringPtrMap< V >::SetNewItem ( const JString key,
const V &  data 
)

◆ SetNewItem() [2/2]

template<class V >
bool JStringPtrMap< V >::SetNewItem ( const JUtf8Byte key,
const V &  data 
)

◆ SetOldItem() [1/4]

template<class V >
bool JStringPtrMap< V >::SetOldItem ( const JString key,
const V &  data,
const JPtrArrayT::SetAction  action 
)

◆ SetOldItem() [2/4]

template<class V >
bool JStringPtrMap< V >::SetOldItem ( const JString key,
V *  ptr,
const JPtrArrayT::SetAction  action 
)
inline

◆ SetOldItem() [3/4]

template<class V >
bool JStringPtrMap< V >::SetOldItem ( const JUtf8Byte key,
const V &  data,
const JPtrArrayT::SetAction  action 
)

◆ SetOldItem() [4/4]

template<class V >
bool JStringPtrMap< V >::SetOldItem ( const JUtf8Byte key,
V *  ptr,
const JPtrArrayT::SetAction  action 
)
inline

Friends And Related Symbol Documentation

◆ JStringMapCursor< V * >

template<class V >
friend class JStringMapCursor< V * >
friend

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