Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / tt / slib / mp_signature.h
1 /*%%  (c) Copyright 1993, 1994 Hewlett-Packard Company                   */
2 /*%%  (c) Copyright 1993, 1994 International Business Machines Corp.     */
3 /*%%  (c) Copyright 1993, 1994 Sun Microsystems, Inc.                    */
4 /*%%  (c) Copyright 1993, 1994 Novell, Inc.                              */
5 /*%%  $XConsortium: mp_signature.h /main/3 1995/10/23 12:01:36 rswiston $                                                        */
6 /*
7  * Tool Talk Message Passer (MP) - mp_signature.h
8  *
9  * Copyright (c) 1990 by Sun Microsystems, Inc.
10  *
11  * Declaration of the _Tt_signature & _Tt_signature_list classes.
12  */
13
14 #ifndef _MP_SIGNATURE_H
15 #define _MP_SIGNATURE_H
16 #include "mp/mp_global.h"
17 #include "mp/mp_arg_utils.h"
18 #include "mp_signature_utils.h"
19 #include "mp/mp_context_utils.h"
20 #include "mp/mp_trace.h"
21 /*
22  * _Tt_signature is used to represent the signature of a method or
23  * procedure. 
24  */
25
26
27
28 class _Tt_signature : public _Tt_object {
29       public:
30         _Tt_signature();
31         _Tt_signature(_Tt_signature_ptr sig);
32         virtual ~_Tt_signature();
33         Tt_scope                scope() const;
34         const _Tt_arg_list_ptr  &args() const;
35         const _Tt_context_list_ptr      &contexts() const;
36         Tt_class                message_class() const;
37         Tt_category             category() const;
38         const _Tt_string &      op() const;
39         int                     opnum() const;
40         Tt_disposition          reliability() const;
41         const _Tt_string &      ptid() const;
42
43         /* only relevant for otype signatures */
44         const _Tt_string &      otid() const;
45         _Tt_string              super_otid();
46
47         void                    set_scope(Tt_scope scope);
48         void                    set_args(_Tt_arg_list_ptr &args);
49         void                    set_message_class(Tt_class mclass);
50         void                    set_pattern_category(Tt_category kind);
51         void                    set_op(_Tt_string op);
52         void                    set_opnum(int opnum);
53         void                    set_reliability(Tt_disposition r);
54         void                    set_ptid(_Tt_string ptid);
55         void                    set_otid(_Tt_string otid);
56         void                    set_super_otid(_Tt_string otid);
57         int                     match(
58                                         Tt_scope s,
59                                         Tt_class c,
60                                         const _Tt_string &op,
61                                         const _Tt_arg_list_ptr &args,
62                                         const _Tt_string &otype,
63                                         const _Tt_context_list_ptr &contexts,
64                                         const _Tt_msg_trace *trace,
65                                         int &was_exact
66                                 ) const;
67         int                     match(
68                                         const _Tt_string &op,
69                                         const _Tt_arg_list_ptr &args,
70                                         const _Tt_context_list_ptr &contexts,
71                                         _Tt_string &reason,
72                                         int &was_exact
73                                 ) const;
74         void                    append_arg(_Tt_arg_ptr &arg);
75         void                    append_context(_Tt_context_ptr &c);
76         void                    print(const _Tt_ostream &os) const;
77         void                    pretty_print(const _Tt_ostream &os) const;
78         static void             pretty_print_(const _Tt_ostream &os,
79                                         const _Tt_object *obj);
80         static void             pretty_print_(const _Tt_ostream &os,
81                                         const _Tt_signature_list_ptr &sigs,
82                                         Tt_category category,
83                                         int skip_sigs_with_otid);
84         bool_t                  xdr(XDR *xdrs);
85         int                     operator==(const _Tt_signature &sig) const;
86         int                     is_same_method(const _Tt_signature &sig) const;
87         int                     is_ce_equal(_Tt_signature &st);
88         void                    *ce_entry;
89         unsigned int            timestamp() const
90                                         { return _timestamp; }
91         void                    set_timestamp(unsigned int stamp)
92                                         { _timestamp = stamp; }
93         int                     xdr_version_required() const;
94         static int              xdr_version_required_(
95                                         const _Tt_signature_list_ptr &sigs);
96       private:
97         friend class _Tt_typedb;
98         _Tt_string              _mangled_args;
99         Tt_scope                _scope;
100         _Tt_arg_list_ptr        _args;
101         _Tt_context_list_ptr    _contexts;
102         Tt_class                _message_class;
103         Tt_category             _pattern_category;
104         _Tt_string              _op;
105         Tt_disposition          _reliability;
106         int                     _opnum;
107         _Tt_string              _ptid;
108         _Tt_string              _otid;
109         _Tt_string              _super_otid;
110         unsigned int            _timestamp;
111 };
112
113
114 #endif                          /* _MP_SIGNATURE_H */