mp_s_msg_context.C 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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_s_msg_context.C /main/3 1995/10/23 11:56:51 rswiston $
  28. /*
  29. *
  30. * @(#)mp_s_msg_context.C 1.4 29 Jul 1993
  31. *
  32. * Tool Talk Message Passer (MP) - mp_s_msg_context.cc
  33. *
  34. * Copyright (c) 1992 by Sun Microsystems, Inc.
  35. *
  36. * _Tt_s_msg_context knows the server side of the context RPC interface.
  37. */
  38. #include <mp/mp_arg.h>
  39. #include <mp/mp_procid.h>
  40. #include "mp_s_pattern.h"
  41. #include "mp_s_msg_context.h"
  42. _Tt_s_msg_context::_Tt_s_msg_context()
  43. {
  44. }
  45. _Tt_s_msg_context::~_Tt_s_msg_context()
  46. {
  47. }
  48. Tt_status
  49. _Tt_s_msg_context::s_join(
  50. _Tt_procid_ptr &procID
  51. ) const
  52. {
  53. _Tt_pattern_list_cursor patC( procID->patterns() );
  54. Tt_status status;
  55. Tt_status worstStatus = TT_OK;
  56. while (patC.next()) {
  57. status = ((_Tt_s_pattern &)**patC).join_context( *this );
  58. switch (status) {
  59. case TT_OK:
  60. case TT_WRN_NOTFOUND:
  61. break;
  62. default:
  63. worstStatus = status;
  64. }
  65. }
  66. return worstStatus;
  67. }
  68. Tt_status
  69. _Tt_s_msg_context::s_quit(
  70. _Tt_procid_ptr &procID
  71. ) const
  72. {
  73. _Tt_pattern_list_cursor patC( procID->patterns() );
  74. Tt_status status;
  75. Tt_status worstStatus = TT_OK;
  76. while (patC.next()) {
  77. status = ((_Tt_s_pattern &)**patC).quit_context( *this );
  78. switch (status) {
  79. case TT_OK:
  80. case TT_WRN_NOTFOUND:
  81. break;
  82. default:
  83. worstStatus = status;
  84. }
  85. }
  86. return worstStatus;
  87. }