-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcsm2to3-private.h
55 lines (48 loc) · 2.01 KB
/
csm2to3-private.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//#############################################################################
//## Restricted Rights
//## WARNING: This is a restricted distribution HARRIS REPOSITORY file.
//## Do Not Use Under A Government Charge Number Without Permission.
//#############################################################################
//*****************************************************************************
// FILE: csm2to3-private.h
//
// Copyright (C) 2012 Harris Corporation. All rights reserved.
//
// CLASSIFICATION: Unclassified
//
// DESCRIPTION: This file contains implementation private functions and
// macros shared among the CSM 2to3 files. Do not
// distribute this file.
//
// LIMITATIONS: None
//
// SOFTWARE HISTORY:
//>
// Date Author Comment
// ----------- ------ -------
// 30-Mar-2012 SCM Initial Coding.
// 12-Sep-2013 JPK Moved DROP_WARNING and SAVE_WARNING here from
// csm2to3model.cc
//<
//*****************************************************************************
#ifndef csm2to3_private_HEADER
#define csm2to3_private_HEADER
#define EXCEPTION_TRY(m) static const char* const MODULE = m; try {
#define EXCEPTION_RETHROW_CONVERT \
} catch(const csm::Error& csm) { \
throw; \
} catch(TSMError& tsm) { \
throw csm::Error((csm::Error::ErrorType)tsm.getError(), \
tsm.getMessage(), \
tsm.getFunction()); \
} catch(...) { \
throw csm::Error(csm::Error::UNKNOWN_ERROR, "Unkown exception", MODULE); \
}
#define CONVERT_WARNING(w) \
csm::Warning((csm::Warning::WarningType)((w)->getWarning()), \
(w)->getMessage(), (w)->getFunction())
#define DROP_WARNING(expr) \
do { TSMWarning* w = expr; if (w) delete w; } while (0)
#define SAVE_WARNING(expr,warnings) \
do { TSMWarning* w = expr; if (w) { if (warnings) warnings->push_back(CONVERT_WARNING(w)); delete w; } } while (0)
#endif