check_status.cpp
Go to the documentation of this file.
1 /*
2  * OpenSplice DDS
3  *
4  * This software and documentation are Copyright 2006 to 2013 PrismTech
5  * Limited and its licensees. All rights reserved. See file:
6  *
7  * $OSPL_HOME/LICENSE
8  *
9  * for full copyright notice and license terms.
10  *
11  */
12 
13 /************************************************************************
14  * LOGICAL_NAME: CheckStatus.cpp
15  * FUNCTION: OpenSplice NetworkPartitions example code.
16  * MODULE: NetworkPartitions example for the C++ programming language.
17  * DATE june 2007.
18  ************************************************************************
19  *
20  * This file contains the implementation for the error handling operations.
21  *
22  ***/
23 
25 
26 /* Array to hold the names for all ReturnCodes. */
27 const char *RetCodeName[13] = {
28  "DDS_RETCODE_OK",
29  "DDS_RETCODE_ERROR",
30  "DDS_RETCODE_UNSUPPORTED",
31  "DDS_RETCODE_BAD_PARAMETER",
32  "DDS_RETCODE_PRECONDITION_NOT_MET",
33  "DDS_RETCODE_OUT_OF_RESOURCES",
34  "DDS_RETCODE_NOT_ENABLED",
35  "DDS_RETCODE_IMMUTABLE_POLICY",
36  "DDS_RETCODE_INCONSISTENT_POLICY",
37  "DDS_RETCODE_ALREADY_DELETED",
38  "DDS_RETCODE_TIMEOUT",
39  "DDS_RETCODE_NO_DATA",
40  "DDS_RETCODE_ILLEGAL_OPERATION" };
41 
45 const char *getErrorName(DDS::ReturnCode_t status)
46 {
47  return RetCodeName[status];
48 }
49 
54  DDS::ReturnCode_t status,
55  const char *info ) {
56 
57  if (status != DDS::RETCODE_OK && status != DDS::RETCODE_NO_DATA) {
58  cerr << "Error in " << info << ": " << getErrorName(status) << endl;
59  exit (1);
60  }
61 }
62 
67  void *handle,
68  const char *info ) {
69 
70  if (!handle) {
71  cerr << "Error in " << info << ": Creation failed: invalid handle" << endl;
72  exit (1);
73  }
74 }
const char * getErrorName(DDS::ReturnCode_t status)
const char * RetCodeName[13]
void checkStatus(DDS::ReturnCode_t status, const char *info)
void checkHandle(void *handle, const char *info)


opensplice_dds_comm
Author(s):
autogenerated on Thu Jun 1 2017 02:43:49