4 * $TOG: MsgHndArray.hh /main/9 1998/09/02 15:54:58 mgreess $
6 * RESTRICTED CONFIDENTIAL INFORMATION:
8 * The information in this document is subject to special
9 * restrictions in a confidential disclosure agreement between
10 * HP, IBM, Sun, USL, SCO and Univel. Do not distribute this
11 * document outside HP, IBM, Sun, USL, SCO, or Univel without
12 * Sun's specific written approval. This document and all copies
13 * and derivative works thereof must be returned or destroyed at
16 * Copyright 1993 Sun Microsystems, Inc. All rights reserved.
21 #ifndef _MSGHNDARRAY_HH
22 #define _MSGHNDARRAY_HH
26 #if defined(USL) && (OSMAJORVERSION == 2)
29 #if defined(USL) && (OSMAJORVERSION == 2)
32 #include <DtMail/DtMail.hh>
36 MsgStruct() : indexNumber(0), sessionNumber(0), message_handle(NULL), is_deleted(false) {};
41 DtMailMessageHandle message_handle;
48 MsgStruct **_contents;
52 MsgHndArray(int sz = 1024, int zeroed = 1)
54 _contents = (MsgStruct**) malloc(sizeof(MsgStruct*)*sz);
56 if (zeroed) memset(_contents, 0, sizeof(MsgStruct *)*sz);
64 // for (int ent = 0; ent < _length; ent++) {
65 // delete _contents[ent];
68 free((void*) _contents);
72 MsgStruct* at(int a_number);
73 int insert(MsgStruct* a_msg_struct);
75 int indexof(MsgStruct* a_msg_struct);
76 int indexof(DtMailMessageHandle a_msg_handle);
77 void remove_entry(int position);
78 void remove_entry(MsgStruct *ms);
79 void append(MsgStruct *a_msg_struct);
80 void mark_for_delete(int position);
81 void compact(int start_pos);
82 void replace(int postition, MsgStruct *a_msg_struct);