21 #ifndef CONFIGURATIONEXCEPTIONS_H
22 #define CONFIGURATIONEXCEPTIONS_H
28 #include "baseexception.h"
34 #pragma warning(disable:4996)
61 strncpy(m_className, className, 256);
62 m_className[255] =
'\0';
63 sprintf(m_errorMessage,
"No class \"%s\" registered into Factory", m_className);
64 m_errorMessage[511] =
'\0';
75 strncpy(m_className, other.m_className, 256);
76 m_className[255] =
'\0';
77 strncpy(m_errorMessage, other.m_errorMessage, 512);
78 m_errorMessage[511] =
'\0';
92 BaseException::operator=(other);
93 strncpy(m_className, other.m_className, 256);
94 m_className[255] =
'\0';
95 strncpy(m_errorMessage, other.m_errorMessage, 512);
96 m_errorMessage[511] =
'\0';
113 virtual const char *what()
const throw()
115 return m_errorMessage;
123 const char *className()
const throw()
138 char m_className[256];
143 char m_errorMessage[512];
162 m_destTypeId(&destTypeId)
164 strncpy(m_className, className, 256);
165 m_className[255] =
'\0';
168 strncpy(tmp, m_destTypeId->name(), 256);
170 sprintf(m_errorMessage,
"Impossible to convert object of type \"%s\" to type \"%s\"", m_className, tmp);
171 m_errorMessage[1023] =
'\0';
180 BaseException(other),
181 m_destTypeId(other.m_destTypeId)
183 strncpy(m_className, other.m_className, 256);
184 m_className[255] =
'\0';
185 strncpy(m_errorMessage, other.m_errorMessage, 1024);
186 m_errorMessage[1023] =
'\0';
196 if (&other ==
this) {
200 BaseException::operator=(other);
201 strncpy(m_className, other.m_className, 256);
202 m_className[255] =
'\0';
203 m_destTypeId = other.m_destTypeId;
204 strncpy(m_errorMessage, other.m_errorMessage, 1024);
205 m_errorMessage[1023] =
'\0';
222 virtual const char *what()
const throw()
224 return m_errorMessage;
232 const char *className()
const throw()
244 const std::type_info& destTypeName()
const throw()
246 return *m_destTypeId;
259 char m_className[256];
265 const std::type_info* m_destTypeId;
270 char m_errorMessage[1024];
289 strncpy(m_groupName, groupName, 256);
290 m_groupName[255] =
'\0';
291 sprintf(m_errorMessage,
"No \"type\" parameter in the given parameter object under the \"%s\" group", m_groupName);
292 m_errorMessage[511] =
'\0';
303 strncpy(m_groupName, other.m_groupName, 256);
304 m_groupName[255] =
'\0';
305 strncpy(m_errorMessage, other.m_errorMessage, 512);
306 m_errorMessage[511] =
'\0';
316 if (&other ==
this) {
320 BaseException::operator=(other);
321 strncpy(m_groupName, other.m_groupName, 256);
322 m_groupName[255] =
'\0';
323 strncpy(m_errorMessage, other.m_errorMessage, 512);
324 m_errorMessage[511] =
'\0';
341 virtual const char *what()
const throw()
343 return m_errorMessage;
351 const char *groupName()
const throw()
367 char m_groupName[256];
372 char m_errorMessage[512];
390 strncpy(m_prefix, prefix, 256);
391 m_prefix[255] =
'\0';
392 sprintf(m_errorMessage,
"The provided prefix (\"%s\") is not a group name, cannot ceate object", m_prefix);
393 m_errorMessage[511] =
'\0';
404 strncpy(m_prefix, other.m_prefix, 256);
405 m_prefix[255] =
'\0';
406 strncpy(m_errorMessage, other.m_errorMessage, 512);
407 m_errorMessage[511] =
'\0';
417 if (&other ==
this) {
421 BaseException::operator=(other);
422 strncpy(m_prefix, other.m_prefix, 256);
423 m_prefix[255] =
'\0';
424 strncpy(m_errorMessage, other.m_errorMessage, 512);
425 m_errorMessage[511] =
'\0';
442 virtual const char *what()
const throw()
444 return m_errorMessage;
452 const char *prefix()
const throw()
472 char m_errorMessage[512];
492 strncpy(m_groupName, groupName, 256);
493 m_groupName[255] =
'\0';
494 sprintf(m_errorMessage,
"Cyclic dependency discovered when creating/configuring object for group \"%s\"", m_groupName);
495 m_errorMessage[511] =
'\0';
506 strncpy(m_groupName, other.m_groupName, 256);
507 m_groupName[255] =
'\0';
508 strncpy(m_errorMessage, other.m_errorMessage, 512);
509 m_errorMessage[511] =
'\0';
519 if (&other ==
this) {
523 BaseException::operator=(other);
524 strncpy(m_groupName, other.m_groupName, 256);
525 m_groupName[255] =
'\0';
526 strncpy(m_errorMessage, other.m_errorMessage, 512);
527 m_errorMessage[511] =
'\0';
544 virtual const char *what()
const throw()
546 return m_errorMessage;
555 const char *groupName()
const throw()
570 char m_groupName[256];
575 char m_errorMessage[512];
590 sprintf(m_errorMessage,
"Trying to perform a copy of ConfigurationParameter objects during calls to getObjectFromGroup");
591 m_errorMessage[255] =
'\0';
602 strncpy(m_errorMessage, other.m_errorMessage, 256);
603 m_errorMessage[255] =
'\0';
613 if (&other ==
this) {
617 BaseException::operator=(other);
618 strncpy(m_errorMessage, other.m_errorMessage, 256);
619 m_errorMessage[255] =
'\0';
636 virtual const char *what()
const throw()
638 return m_errorMessage;
651 char m_errorMessage[256];
673 strncpy(m_groupName, groupName, 256);
674 m_groupName[255] =
'\0';
675 sprintf(m_errorMessage,
"A new object is requested for group \"%s\" while another one is being created or has been created but not configured", m_groupName);
676 m_errorMessage[511] =
'\0';
687 strncpy(m_groupName, other.m_groupName, 256);
688 m_groupName[255] =
'\0';
689 strncpy(m_errorMessage, other.m_errorMessage, 512);
690 m_errorMessage[511] =
'\0';
700 if (&other ==
this) {
704 BaseException::operator=(other);
705 strncpy(m_groupName, other.m_groupName, 256);
706 m_groupName[255] =
'\0';
707 strncpy(m_errorMessage, other.m_errorMessage, 512);
708 m_errorMessage[511] =
'\0';
725 virtual const char *what()
const throw()
727 return m_errorMessage;
736 const char *groupName()
const throw()
751 char m_groupName[256];
756 char m_errorMessage[512];
776 strncpy(m_paramName, paramName, 256);
777 m_paramName[255] =
'\0';
778 sprintf(m_errorMessage,
"The parameter \"%s\" is not marked as runtime modifiable", m_paramName);
779 m_errorMessage[511] =
'\0';
790 strncpy(m_paramName, other.m_paramName, 256);
791 m_paramName[255] =
'\0';
792 strncpy(m_errorMessage, other.m_errorMessage, 512);
793 m_errorMessage[511] =
'\0';
803 if (&other ==
this) {
807 BaseException::operator=(other);
808 strncpy(m_paramName, other.m_paramName, 256);
809 m_paramName[255] =
'\0';
810 strncpy(m_errorMessage, other.m_errorMessage, 512);
811 m_errorMessage[511] =
'\0';
828 virtual const char *what()
const throw()
830 return m_errorMessage;
838 const char *paramName()
const throw()
853 char m_paramName[256];
858 char m_errorMessage[512];
882 strncpy(m_paramName, paramName, 256);
883 m_paramName[255] =
'\0';
884 strncpy(m_paramType, paramType, 256);
885 m_paramType[255] =
'\0';
886 strncpy(m_requestType, requestType, 256);
887 m_requestType[255] =
'\0';
888 sprintf(m_errorMessage,
"Type mismatch on setting/getting parameter \"%s\" - expected \"%s\" - requested \"%s\"", m_paramName, m_paramType, m_requestType);
889 m_errorMessage[1023] =
'\0';
900 strncpy(m_paramName, other.m_paramName, 256);
901 m_paramName[255] =
'\0';
902 strncpy(m_paramType, other.m_paramType, 256);
903 m_paramType[255] =
'\0';
904 strncpy(m_requestType, other.m_requestType, 256);
905 m_requestType[255] =
'\0';
906 strncpy(m_errorMessage, other.m_errorMessage, 1024);
907 m_errorMessage[1023] =
'\0';
917 if (&other ==
this) {
921 BaseException::operator=(other);
922 strncpy(m_paramName, other.m_paramName, 256);
923 m_paramName[255] =
'\0';
924 strncpy(m_paramType, other.m_paramType, 256);
925 m_paramType[255] =
'\0';
926 strncpy(m_requestType, other.m_requestType, 256);
927 m_requestType[255] =
'\0';
928 strncpy(m_errorMessage, other.m_errorMessage, 1024);
929 m_errorMessage[1023] =
'\0';
946 virtual const char *what()
const throw()
948 return m_errorMessage;
956 const char *paramName()
const throw()
966 const char *paramType()
const throw()
976 const char *requestType()
const throw()
978 return m_requestType;
991 char m_paramName[256];
996 char m_paramType[256];
1001 char m_requestType[256];
1006 char m_errorMessage[1024];
1036 strncpy(m_paramName, paramName, 256);
1037 m_paramName[255] =
'\0';
1038 strncpy(m_paramValue, paramValue, 256);
1039 m_paramValue[255] =
'\0';
1040 strncpy(m_description, description, 256);
1041 m_description[255] =
'\0';
1042 sprintf(m_errorMessage,
"User check failed on parameter \"%s\" - parameter value: \"%s\" - error description: %s", m_paramName, m_paramValue, m_description);
1043 m_errorMessage[1023] =
'\0';
1052 BaseException(other)
1054 strncpy(m_paramName, other.m_paramName, 256);
1055 m_paramName[255] =
'\0';
1056 strncpy(m_paramValue, other.m_paramValue, 256);
1057 m_paramValue[255] =
'\0';
1058 strncpy(m_description, other.m_description, 256);
1059 m_description[255] =
'\0';
1060 strncpy(m_errorMessage, other.m_errorMessage, 1024);
1061 m_errorMessage[1023] =
'\0';
1071 if (&other ==
this) {
1075 BaseException::operator=(other);
1076 strncpy(m_paramName, other.m_paramName, 256);
1077 m_paramName[255] =
'\0';
1078 strncpy(m_paramValue, other.m_paramValue, 256);
1079 m_paramValue[255] =
'\0';
1080 strncpy(m_description, other.m_description, 256);
1081 m_description[255] =
'\0';
1082 strncpy(m_errorMessage, other.m_errorMessage, 1024);
1083 m_errorMessage[1023] =
'\0';
1100 virtual const char *what()
const throw()
1102 return m_errorMessage;
1110 const char *paramName()
const throw()
1120 const char *paramValue()
const throw()
1122 return m_paramValue;
1130 const char *description()
const throw()
1132 return m_description;
1145 char m_paramName[256];
1150 char m_paramValue[256];
1155 char m_description[256];
1160 char m_errorMessage[1024];
1179 strncpy(m_resourceName, resourceName, 256);
1180 m_resourceName[255] =
'\0';
1181 sprintf(m_errorMessage,
"No resource declared with name \"%s\"", m_resourceName);
1182 m_errorMessage[511] =
'\0';
1191 BaseException(other)
1193 strncpy(m_resourceName, other.m_resourceName, 256);
1194 m_resourceName[255] =
'\0';
1195 strncpy(m_errorMessage, other.m_errorMessage, 512);
1196 m_errorMessage[511] =
'\0';
1206 if (&other ==
this) {
1210 BaseException::operator=(other);
1211 strncpy(m_resourceName, other.m_resourceName, 256);
1212 m_resourceName[255] =
'\0';
1213 strncpy(m_errorMessage, other.m_errorMessage, 512);
1214 m_errorMessage[511] =
'\0';
1231 virtual const char *what()
const throw()
1233 return m_errorMessage;
1241 const char *resourceName()
const throw()
1243 return m_resourceName;
1256 char m_resourceName[256];
1261 char m_errorMessage[512];
1284 strncpy(m_resourceName, resourceName, 256);
1285 m_resourceName[255] =
'\0';
1286 sprintf(m_errorMessage,
"The resource named \"%s\" was not declared as usable before being used", m_resourceName);
1287 m_errorMessage[511] =
'\0';
1296 BaseException(other)
1298 strncpy(m_resourceName, other.m_resourceName, 256);
1299 m_resourceName[255] =
'\0';
1300 strncpy(m_errorMessage, other.m_errorMessage, 512);
1301 m_errorMessage[511] =
'\0';
1311 if (&other ==
this) {
1315 BaseException::operator=(other);
1316 strncpy(m_resourceName, other.m_resourceName, 256);
1317 m_resourceName[255] =
'\0';
1318 strncpy(m_errorMessage, other.m_errorMessage, 512);
1319 m_errorMessage[511] =
'\0';
1336 virtual const char *what()
const throw()
1338 return m_errorMessage;
1346 const char *resourceName()
const throw()
1348 return m_resourceName;
1361 char m_resourceName[256];
1366 char m_errorMessage[512];
1389 strncpy(m_resourceName, resourceName, 256);
1390 m_resourceName[255] =
'\0';
1391 strncpy(m_typeName, typeName, 256);
1392 m_typeName[255] =
'\0';
1393 sprintf(m_errorMessage,
"Wrong type when requesting a resource; The type of the resource \"%s\" is not \"%s\"", m_resourceName, m_typeName);
1394 m_errorMessage[1023] =
'\0';
1403 BaseException(other)
1405 strncpy(m_resourceName, other.m_resourceName, 256);
1406 m_resourceName[255] =
'\0';
1407 strncpy(m_typeName, other.m_typeName, 256);
1408 m_typeName[255] =
'\0';
1409 strncpy(m_errorMessage, other.m_errorMessage, 1024);
1410 m_errorMessage[1023] =
'\0';
1420 if (&other ==
this) {
1424 BaseException::operator=(other);
1425 strncpy(m_resourceName, other.m_resourceName, 256);
1426 m_resourceName[255] =
'\0';
1427 strncpy(m_typeName, other.m_typeName, 256);
1428 m_typeName[255] =
'\0';
1429 strncpy(m_errorMessage, other.m_errorMessage, 1024);
1430 m_errorMessage[1023] =
'\0';
1447 virtual const char *what()
const throw()
1449 return m_errorMessage;
1457 const char *resourceName()
const throw()
1459 return m_resourceName;
1467 const char *typeName()
const throw()
1482 char m_resourceName[256];
1487 char m_typeName[256];
1492 char m_errorMessage[1024];
1520 strncpy(m_resourceName, resourceName, 256);
1521 m_resourceName[255] =
'\0';
1522 strncpy(m_description, description, 256);
1523 m_description[255] =
'\0';
1524 sprintf(m_errorMessage,
"The user requested a resource named \"%s\" which cannot be found. Error description: %s", m_resourceName, m_description);
1525 m_errorMessage[1023] =
'\0';
1534 BaseException(other)
1536 strncpy(m_resourceName, other.m_resourceName, 256);
1537 m_resourceName[255] =
'\0';
1538 strncpy(m_description, other.m_description, 256);
1539 m_description[255] =
'\0';
1540 strncpy(m_errorMessage, other.m_errorMessage, 1024);
1541 m_errorMessage[1023] =
'\0';
1551 if (&other ==
this) {
1555 BaseException::operator=(other);
1556 strncpy(m_resourceName, other.m_resourceName, 256);
1557 m_resourceName[255] =
'\0';
1558 strncpy(m_description, other.m_description, 256);
1559 m_description[255] =
'\0';
1560 strncpy(m_errorMessage, other.m_errorMessage, 1024);
1561 m_errorMessage[1023] =
'\0';
1578 virtual const char *what()
const throw()
1580 return m_errorMessage;
1588 const char *resourceName()
const throw()
1590 return m_resourceName;
1598 const char *description()
const throw()
1600 return m_description;
1613 char m_resourceName[256];
1618 char m_description[256];
1623 char m_errorMessage[1024];
1647 m_lockStatusLocked(lockStatusLocked)
1649 strncpy(m_operationName, operationName, 256);
1650 m_operationName[255] =
'\0';
1651 sprintf(m_errorMessage,
"The operation \"%s\" could not be performed because the lock on resources %s but it %s have been", m_operationName, (m_lockStatusLocked ?
"was held" :
"wasn't held"), (m_lockStatusLocked ?
"shouldn't" :
"should"));
1652 m_errorMessage[511] =
'\0';
1661 BaseException(other),
1662 m_lockStatusLocked(other.m_lockStatusLocked)
1664 strncpy(m_operationName, other.m_operationName, 256);
1665 m_operationName[255] =
'\0';
1666 strncpy(m_errorMessage, other.m_errorMessage, 512);
1667 m_errorMessage[511] =
'\0';
1677 if (&other ==
this) {
1681 BaseException::operator=(other);
1682 m_lockStatusLocked = other.m_lockStatusLocked;
1683 strncpy(m_operationName, other.m_operationName, 256);
1684 m_operationName[255] =
'\0';
1685 strncpy(m_errorMessage, other.m_errorMessage, 512);
1686 m_errorMessage[511] =
'\0';
1703 virtual const char *what()
const throw()
1705 return m_errorMessage;
1714 bool lockStatusLocked()
const throw()
1716 return m_lockStatusLocked;
1724 const char *operationName()
const throw()
1726 return m_operationName;
1740 bool m_lockStatusLocked;
1745 char m_operationName[256];
1750 char m_errorMessage[512];
1756 #if defined(_MSC_VER)
1757 #pragma warning(pop)