DirectoryClass.hpp
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX Kernel DirectoryClass.hpp */
40 /* */
41 /* Primitive Directory Class Definitions */
42 /* */
43 /******************************************************************************/
44 #ifndef Included_RexxDirectory
45 #define Included_RexxDirectory
46 
47 #include "RexxCollection.hpp"
48 
50  public:
51  inline void * operator new(size_t size, void *objectPtr) { return objectPtr; };
52  inline RexxDirectory(RESTORETYPE restoreType) { ; };
53 
54  void live(size_t);
55  void liveGeneral(int reason);
56  void flatten(RexxEnvelope *);
58  RexxObject *copy();
60 
64  RexxObject *fastAt(RexxString *name) { return this->contents->stringGet(name);}
71  size_t items();
81  void reset();
82  RexxObject *empty();
87 
88  RexxObject *newRexx(RexxObject **init_args, size_t, size_t);
89 
90  RexxTable *method_table; /* table of added methods */
91  RexxMethod *unknown_method; /* unknown method entry */
92 
93  // Helpers for named arguments
94  RexxArray *allIndexesItems(void); // return an array containing all of the directory indices & items: index1, item1, index2, item2, ...
95  size_t pushAllIndexesItemsTo(RexxExpressionStack *stack); // Push on the stack all the directory indices & items: index1, item1, index2, item2, ...
96  size_t appendAllIndexesItemsTo(RexxArray *array, size_t from); // Append to the array all the directory indices & items: index1, item1, index2, item2, ...
97  static RexxDirectory *fromIndexItemArray(RexxObject **arglist, size_t count); // return REF_NULL when count==0, otherwise return a directory made from an array of(index1, item1, index2, item2, ...)
98 
99  static RexxDirectory *newInstance();
100 
101  static void createInstance();
102  // singleton class instance;
104 };
105 
106 
108 
109 #endif
RexxDirectory * new_directory()
RESTORETYPE
Definition: ObjectClass.hpp:82
RexxObject * hasItem(RexxObject *)
RexxArray * allIndexes()
RexxObject * setMethod(RexxString *, RexxMethod *)
RexxObject * copy()
RexxObject * unflatten(RexxEnvelope *)
void liveGeneral(int reason)
RexxObject * indexRexx(RexxObject *)
RexxArray * requestArray()
RexxArray * allItems()
RexxObject * at(RexxString *)
RexxObject * setEntry(RexxString *, RexxObject *)
RexxObject * removeItem(RexxObject *)
RexxObject * mergeItem(RexxObject *, RexxObject *)
RexxObject * hasEntry(RexxString *)
size_t pushAllIndexesItemsTo(RexxExpressionStack *stack)
RexxObject * put(RexxObject *, RexxString *)
void live(size_t)
RexxArray * allIndexesItems(void)
RexxObject * isEmpty()
RexxObject * newRexx(RexxObject **init_args, size_t, size_t)
RexxObject * fastAt(RexxString *name)
size_t appendAllIndexesItemsTo(RexxArray *array, size_t from)
RexxSupplier * supplier()
static RexxDirectory * newInstance()
RexxObject * empty()
void flatten(RexxEnvelope *)
RexxObject * atRexx(RexxString *)
RexxObject * entryRexx(RexxString *)
RexxArray * makeArray()
RexxMethod * unknown_method
RexxDirectory(RESTORETYPE restoreType)
RexxObject * unknown(RexxString *, RexxArray *, RexxDirectory *)
static RexxDirectory * fromIndexItemArray(RexxObject **arglist, size_t count)
RexxObject * itemsRexx()
RexxTable * method_table
static void createInstance()
RexxObject * hasIndex(RexxString *)
RexxObject * entry(RexxString *)
RexxObject * remove(RexxString *)
static RexxClass * classInstance
RexxObject * removeRexx(RexxString *)
RexxHashTable * contents
RexxObject * stringGet(RexxString *key)