2
0

mp_signature.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /*%% (c) Copyright 1993, 1994 Hewlett-Packard Company */
  24. /*%% (c) Copyright 1993, 1994 International Business Machines Corp. */
  25. /*%% (c) Copyright 1993, 1994 Sun Microsystems, Inc. */
  26. /*%% (c) Copyright 1993, 1994 Novell, Inc. */
  27. /*%% $XConsortium: mp_signature.h /main/3 1995/10/23 12:01:36 rswiston $ */
  28. /*
  29. * Tool Talk Message Passer (MP) - mp_signature.h
  30. *
  31. * Copyright (c) 1990 by Sun Microsystems, Inc.
  32. *
  33. * Declaration of the _Tt_signature & _Tt_signature_list classes.
  34. */
  35. #ifndef _MP_SIGNATURE_H
  36. #define _MP_SIGNATURE_H
  37. #include "mp/mp_global.h"
  38. #include "mp/mp_arg_utils.h"
  39. #include "mp_signature_utils.h"
  40. #include "mp/mp_context_utils.h"
  41. #include "mp/mp_trace.h"
  42. /*
  43. * _Tt_signature is used to represent the signature of a method or
  44. * procedure.
  45. */
  46. class _Tt_signature : public _Tt_object {
  47. public:
  48. _Tt_signature();
  49. _Tt_signature(_Tt_signature_ptr sig);
  50. virtual ~_Tt_signature();
  51. Tt_scope scope() const;
  52. const _Tt_arg_list_ptr &args() const;
  53. const _Tt_context_list_ptr &contexts() const;
  54. Tt_class message_class() const;
  55. Tt_category category() const;
  56. const _Tt_string & op() const;
  57. int opnum() const;
  58. Tt_disposition reliability() const;
  59. const _Tt_string & ptid() const;
  60. /* only relevant for otype signatures */
  61. const _Tt_string & otid() const;
  62. _Tt_string super_otid();
  63. void set_scope(Tt_scope scope);
  64. void set_args(_Tt_arg_list_ptr &args);
  65. void set_message_class(Tt_class mclass);
  66. void set_pattern_category(Tt_category kind);
  67. void set_op(_Tt_string op);
  68. void set_opnum(int opnum);
  69. void set_reliability(Tt_disposition r);
  70. void set_ptid(_Tt_string ptid);
  71. void set_otid(_Tt_string otid);
  72. void set_super_otid(_Tt_string otid);
  73. int match(
  74. Tt_scope s,
  75. Tt_class c,
  76. const _Tt_string &op,
  77. const _Tt_arg_list_ptr &args,
  78. const _Tt_string &otype,
  79. const _Tt_context_list_ptr &contexts,
  80. const _Tt_msg_trace *trace,
  81. int &was_exact
  82. ) const;
  83. int match(
  84. const _Tt_string &op,
  85. const _Tt_arg_list_ptr &args,
  86. const _Tt_context_list_ptr &contexts,
  87. _Tt_string &reason,
  88. int &was_exact
  89. ) const;
  90. void append_arg(_Tt_arg_ptr &arg);
  91. void append_context(_Tt_context_ptr &c);
  92. void print(const _Tt_ostream &os) const;
  93. void pretty_print(const _Tt_ostream &os) const;
  94. static void pretty_print_(const _Tt_ostream &os,
  95. const _Tt_object *obj);
  96. static void pretty_print_(const _Tt_ostream &os,
  97. const _Tt_signature_list_ptr &sigs,
  98. Tt_category category,
  99. int skip_sigs_with_otid);
  100. bool_t xdr(XDR *xdrs);
  101. int operator==(const _Tt_signature &sig) const;
  102. int is_same_method(const _Tt_signature &sig) const;
  103. int is_ce_equal(_Tt_signature &st);
  104. void *ce_entry;
  105. unsigned int timestamp() const
  106. { return _timestamp; }
  107. void set_timestamp(unsigned int stamp)
  108. { _timestamp = stamp; }
  109. int xdr_version_required() const;
  110. static int xdr_version_required_(
  111. const _Tt_signature_list_ptr &sigs);
  112. private:
  113. friend class _Tt_typedb;
  114. _Tt_string _mangled_args;
  115. Tt_scope _scope;
  116. _Tt_arg_list_ptr _args;
  117. _Tt_context_list_ptr _contexts;
  118. Tt_class _message_class;
  119. Tt_category _pattern_category;
  120. _Tt_string _op;
  121. Tt_disposition _reliability;
  122. int _opnum;
  123. _Tt_string _ptid;
  124. _Tt_string _otid;
  125. _Tt_string _super_otid;
  126. unsigned int _timestamp;
  127. };
  128. #endif /* _MP_SIGNATURE_H */