C++ TargetRTS
Loading...
Searching...
No Matches
RTDictionary.h
1/*
2 * Licensed Materials - Property of HCL and/or IBM
3 * Copyright HCL Technologies Ltd. 2016, 2021. All Rights Reserved.
4 * Copyright IBM Corporation 1999, 2016. All Rights Reserved.
5 *
6 * U.S. Government Users Restricted Rights - Use, duplication or
7 * disclosure restricted by GSA ADP Schedule.
8 */
9
10#ifndef __RTDictionary_h__
11#define __RTDictionary_h__ included
12
13#ifdef PRAGMA
14#pragma interface
15#endif
16
17#ifndef __RTAssociation_h__
18#include <RTAssociation.h>
19#endif
20
22{
23protected:
24 unsigned _size;
25 unsigned _used;
26 RTAssociation * _contents;
27
28 RTAssociation * find( const char * ) const;
29
30public:
31 explicit RTDictionary( unsigned initialSize = 0 );
32 RTDictionary( const RTDictionary & );
33 ~RTDictionary( void );
34
35 RTDictionary & operator=( const RTDictionary & );
36
37 RTS_INLINE unsigned size( void ) const;
38
39 int atPut( const char * key, void * value );
40 RTS_INLINE int add( const RTAssociation & );
41 int remove( const char * key );
42 void * operator[]( const char * key ) const;
43
44 static unsigned hash( const char *, unsigned );
45
47 {
48 friend class RTDictionary;
49 private:
50 unsigned _index;
51
52 public:
53 RTS_INLINE Iterator( void );
54 RTS_INLINE ~Iterator( void );
55 RTS_INLINE void reset( void );
56 };
57
58 const RTAssociation * iterate( Iterator & ) const;
59};
60
61#if RTS_INLINES
62#include <RTDictionary.inl>
63#endif
64
65#endif // __RTDictionary_h__
Definition: RTDictionary.h:47
Definition: RTDictionary.h:22
Definition: RTAssociation.h:22