OpenASIP 2.2
Loading...
Searching...
No Matches
Classes | Macros
Exception.hh File Reference
#include <string>
#include "Exception.icc"
Include dependency graph for Exception.hh:

Go to the source code of this file.

Classes

class  Exception
 
class  IllegalParameters
 
class  IOException
 
class  InvalidData
 
class  UnreachableStream
 
class  EndOfFile
 
class  WritePastEOF
 
class  FileNotFound
 
class  PathNotFound
 
class  KeyAlreadyExists
 
class  KeyNotFound
 
class  InstanceNotFound
 
class  OutOfRange
 
class  WrongSubclass
 
class  NotChunkable
 
class  UnresolvedReference
 
class  ErrorInExternalFile
 
class  MissingKeys
 
class  NumberFormatException
 
class  IllegalCommandLine
 
class  UnexpectedValue
 
class  IllegalConnectivity
 
class  ParserStopRequest
 
class  ComponentAlreadyExists
 
class  IllegalRegistration
 
class  ObjectStateLoadingException
 
class  NonexistingChild
 
class  DynamicLibraryException
 
class  MultipleInstancesFound
 
class  SymbolNotFound
 
class  ObjectNotInitialized
 
class  ScriptExecutionFailure
 
class  SerializerException
 
class  RelationalDBException
 
class  StartTooLate
 
class  NotAvailable
 
class  CannotEstimateCost
 
class  WrongOperandType
 
class  BadOperationModule
 
class  TypeMismatch
 
class  InvalidName
 
class  IllegalOperationBehavior
 
class  NonexistingSyscall
 
class  IllegalMachine
 
class  IllegalProgram
 
class  SimulationException
 
class  SimulationStillRunning
 
class  SimulationExecutionError
 
class  SimulationCycleLimitReached
 
class  SimulationTimeOut
 
class  ObjectAlreadyExists
 
class  CompileError
 
class  ModuleRunTimeError
 
class  NoKnownConversion
 

Macros

#define THROW_EXCEPTION(exceptionType, message)    throw exceptionType(__FILE__, __LINE__, __func__, std::string() + message)
 Exception wrapper macro that automatically includes file name, line number and function name where the throw is made.
 

Detailed Description

Declarations of exception classes.

Author
Mikael Lepistö 2003 (tmlepist-no.spam-cs.tut.fi)

Definition in file Exception.hh.

Macro Definition Documentation

◆ THROW_EXCEPTION

#define THROW_EXCEPTION (   exceptionType,
  message 
)     throw exceptionType(__FILE__, __LINE__, __func__, std::string() + message)

Exception wrapper macro that automatically includes file name, line number and function name where the throw is made.

Definition at line 39 of file Exception.hh.

53 {
54public:
56 std::string filename, int linenum,
57 std::string procname = unknownProcMsg_,
58 std::string errorMessage = "");
59
60 virtual ~Exception();
61
62 std::string fileName() const;
63 int lineNum() const;
64 std::string procedureName() const;
65 std::string errorMessage() const;
66 std::string errorMessageStack(bool messagesOnly = false) const;
67
68 /// Used when no procedure name is given.
69 static const std::string unknownProcMsg_;
70
71 /// Returns information of the last thrown exception.
72 static std::string lastExceptionInfo();
73
74 void setCause(const Exception &cause);
75 bool hasCause() const;
76 const Exception& cause() const;
77
78private:
79 /// Information of the last thrown exception for easing the debugging.
80 static std::string lastExceptionInfo_;
81 /// Name of the file where exception occurred.
82 std::string file_;
83 /// Line number in the file.
84 int line_;
85 /// Procedure name.
86 std::string proc_;
87 /// Error message
88 std::string errorMessage_;
89 /// Exception that caused current exception.
90 const Exception* cause_;
91};
92
93///////////////////////////////////////////////////////////////////////////////
94// IllegalParameters
95///////////////////////////////////////////////////////////////////////////////
96
97/**
98 * IllegalParameters exception is the base class for all exceptional
99 * conditions that are caused by input parameters given to the throwing
100 * function. An IllegalParameters is a valid parameter of its type (in
101 * terms of value range and type sanity) that in the context in which the
102 * function is called denotes a corrupted state. IllegalParameters
103 * conditions may occur when the throwing function is invoked in ways that
104 * violate some constraint, such as for example, an order constraint
105 * (precedence) or a logical constraint (conflict between parameter values
106 * given at different invocations).
107 *
108 * An IllegalParameters condition is "by definition" not to be treated as an
109 * assert, because the problem is typically originated by the client of the
110 * throwing function.
111 */
112class IllegalParameters : public Exception {
113public:
115 std::string filename, int linenum,
116 std::string procname = unknownProcMsg_,
117 std::string errorMessage = "");
118 virtual ~IllegalParameters() {};
119};
120
121///////////////////////////////////////////////////////////////////////////////
122// IOException
123///////////////////////////////////////////////////////////////////////////////
124
125/**
126 * Base class for exceptions which are occured when trying to
127 * do reading or writing.
128 */
129class IOException : public Exception {
130public:
132 std::string filename, int linenum,
133 std::string procname = unknownProcMsg_,
134 std::string errorMessage = "");
135 virtual ~IOException() {};
136};
137
138///////////////////////////////////////////////////////////////////////////////
139// InvalidData
140///////////////////////////////////////////////////////////////////////////////
141
142/**
143 * Base class for exceptions which occur because an object contains invalid
144 * data. The object could be a parameter passed to a method (invalid
145 * parameter), or an object whose a method is invoked (method incompatible
146 * with the current object state).
147 */
148class InvalidData : public Exception {
149public:
151 std::string filename, int linenum,
152 std::string procname = unknownProcMsg_,
153 std::string errorMessage = "");
154 virtual ~InvalidData() {};
155};
156
157///////////////////////////////////////////////////////////////////////////////
158// UnreachableStream
159///////////////////////////////////////////////////////////////////////////////
160
161/**
162 * Implements an exception which is thrown when trying to read from
163 * or write to a stream that cannot be opened or appears otherwise
164 * unreachable.
165 *
166 * It contains information about the file name, line number and
167 * procedure name in which this exception was thrown, and the stream
168 * name.
169 */
170class UnreachableStream : public IOException {
171public:
173 std::string filename, int linenum,
174 std::string procname = unknownProcMsg_,
175 std::string errorMessage = "");
176
177 virtual ~UnreachableStream();
178};
179
180///////////////////////////////////////////////////////////////////////////////
181// EndOfFile
182///////////////////////////////////////////////////////////////////////////////
183
184/**
185 * Implements an exception which is thrown when trying to read from
186 * stream when end of file has been reached.
187 */
188class EndOfFile : public IOException {
189public:
190 EndOfFile(
191 std::string filename, int linenum,
192 std::string procname = unknownProcMsg_,
193 std::string errorMessage = "");
194 virtual ~EndOfFile();
195};
196
197
198///////////////////////////////////////////////////////////////////////////////
199// WritePastEOF
200///////////////////////////////////////////////////////////////////////////////
201
202/**
203 * Implements an exception which is thrown when trying to write to
204 * a stream when the write cursor has been set past the end of file.
205 */
206class WritePastEOF : public IOException {
207public:
209 std::string filename, int linenum,
210 std::string procname = unknownProcMsg_,
211 std::string errorMessage = "");
212 virtual ~WritePastEOF();
213};
214
215///////////////////////////////////////////////////////////////////////////////
216// FileNotFound
217///////////////////////////////////////////////////////////////////////////////
218
219/**
220 * Implements an exception which is thrown when a requested file is not
221 * found.
222 */
223class FileNotFound : public IOException {
224public:
226 std::string filename,
227 int linenum,
228 std::string procname = unknownProcMsg_,
229 std::string errorMessage = "");
230 virtual ~FileNotFound();
231};
232
233///////////////////////////////////////////////////////////////////////////////
234// PathNotFound
235///////////////////////////////////////////////////////////////////////////////
236
237/**
238 * Implements an exception which is thrown when a requested path is not
239 * found.
240 */
241class PathNotFound : public IOException {
242public:
244 std::string filename,
245 int linenum,
246 std::string procname,
247 std::string errorMessage,
248 std::string path);
249 virtual ~PathNotFound();
250
251 std::string path() const;
252
253private:
254 std::string path_;
255
256};
257
258
259///////////////////////////////////////////////////////////////////////////////
260// KeyAlreadyExists
261///////////////////////////////////////////////////////////////////////////////
262
263/**
264 * Implements an exception which is thrown when trying to add an entry
265 * to a reference key map that already contains an entry with given key.
266 */
267class KeyAlreadyExists : public IllegalParameters {
268public:
270 std::string filename, int linenum,
271 std::string procname = unknownProcMsg_,
272 std::string errorMessage = "");
273 virtual ~KeyAlreadyExists() {};
274};
275
276///////////////////////////////////////////////////////////////////////////////
277// KeyNotFound
278///////////////////////////////////////////////////////////////////////////////
279
280/**
281 * Implements an exception which is thrown when a requested key for
282 * object is not found.
283 */
284class KeyNotFound : public IllegalParameters {
285public:
287 std::string filename, int linenum,
288 std::string procname = unknownProcMsg_,
289 std::string errorMessage = "");
290 virtual ~KeyNotFound() {};
291};
292
293///////////////////////////////////////////////////////////////////////////////
294// InstanceNotFound
295///////////////////////////////////////////////////////////////////////////////
296
297/**
298 * Implements an exception which is thrown when can't find
299 * an instance of a class that is requested.
300 * For example in BinaryReader::readData, Section::createSection and
301 * SectionReader::readSection.
302 */
303class InstanceNotFound : public IllegalParameters {
304public:
306 std::string filename, int linenum,
307 std::string procname = unknownProcMsg_,
308 std::string errorMessage = "");
309 virtual ~InstanceNotFound();
310};
311
312///////////////////////////////////////////////////////////////////////////////
313// OutOfRange
314///////////////////////////////////////////////////////////////////////////////
315
316/**
317 * Implements an exception which is thrown when something is out of range.
318 */
319class OutOfRange : public InvalidData {
320public:
322 std::string filename, int linenum,
323 std::string procname = unknownProcMsg_,
324 std::string errorMessage = "");
325 virtual ~OutOfRange() {};
326};
327
328///////////////////////////////////////////////////////////////////////////////
329// WrongSubclass
330///////////////////////////////////////////////////////////////////////////////
331
332/**
333 * Class is not capable to do that thing that was wanted.
334 */
335class WrongSubclass : public InvalidData {
336public:
338 std::string filename, int linenum,
339 std::string procname = unknownProcMsg_,
340 std::string errorMessage = "");
341 virtual ~WrongSubclass() {};
342};
343
344///////////////////////////////////////////////////////////////////////////////
345// NotChunkable
346///////////////////////////////////////////////////////////////////////////////
347
348/**
349 * Implements an exception which is thrown when trying get chunk object
350 * from section that does not override base classe's chunk() method.
351 */
352class NotChunkable : public WrongSubclass {
353public:
355 std::string filename, int linenum,
356 std::string procname = unknownProcMsg_,
357 std::string errorMessage = "");
358 virtual ~NotChunkable() {};
359};
360
361///////////////////////////////////////////////////////////////////////////////
362// UnresolvedReference
363///////////////////////////////////////////////////////////////////////////////
364
365/**
366 * Implements an exception which is thrown when reference manager
367 * finds unresolvable references while trying to resolve().
368 */
369class UnresolvedReference : public InvalidData {
370public:
372 std::string filename, int linenum,
373 std::string procname = unknownProcMsg_,
374 std::string errorMessage = "");
375 virtual ~UnresolvedReference() {};
376};
377
378
379///////////////////////////////////////////////////////////////////////////////
380// ErrorInExternalFile
381///////////////////////////////////////////////////////////////////////////////
382
383/**
384 * Exception which is thrown when Schema parser finds errors in the file.
385 */
386class ErrorInExternalFile : public InvalidData {
387public:
389 std::string filename, int linenum,
390 std::string procname = unknownProcMsg_,
391 std::string errorMessage = "");
392 virtual ~ErrorInExternalFile();
393};
394
395///////////////////////////////////////////////////////////////////////////////
396// MissingKeys
397///////////////////////////////////////////////////////////////////////////////
398
399/**
400 * Exception which is thrown when trying to do replacement while writing
401 * binary file and reference manager doesn't contain enough keys for
402 * computing replacement value.
403 */
404class MissingKeys : public InvalidData {
405public:
407 std::string filename, int linenum,
408 std::string procname = unknownProcMsg_,
409 std::string errorMessage = "");
410 virtual ~MissingKeys();
411};
412
413/////////////////////////////////////////////////////////////////////////////
414// NumberFormatException
415/////////////////////////////////////////////////////////////////////////////
416/**
417 * Exception which is thrown when trying to convert an illegal number to
418 * another type.
419 */
420class NumberFormatException : public InvalidData {
421public:
423 std::string filename, int linenum,
424 std::string procname = unknownProcMsg_,
425 std::string errorMessage = "");
426 virtual ~NumberFormatException();
427};
428
429///////////////////////////////////////////////////////////////////////////////
430// IllegalCommandLine
431///////////////////////////////////////////////////////////////////////////////
432
433/**
434 * Exception which is thrown when user given command line is somehow
435 * erronous.
436 */
437class IllegalCommandLine : public InvalidData {
438public:
440 std::string filename, int linenum,
441 std::string procname = unknownProcMsg_,
442 std::string errorMessage = "");
443 virtual ~IllegalCommandLine();
444};
445
446///////////////////////////////////////////////////////////////////////////////
447// UnexpectedValue
448///////////////////////////////////////////////////////////////////////////////
449
450/**
451 * Exception which is thrown when user given command line is somehow
452 * erronous.
453 */
454class UnexpectedValue : public InvalidData {
455public:
457 std::string filename, int linenum,
458 std::string procname = unknownProcMsg_,
459 std::string errorMessage = "");
460 virtual ~UnexpectedValue();
461};
462
463
464/////////////////////////////////////////////////////////////////////////////
465// IllegalConnectivity
466/////////////////////////////////////////////////////////////////////////////
467
468/**
469 * Exception which is thrown when tried to make something impossible because
470 * of the connectivity of the object.
471 */
472class IllegalConnectivity : public Exception {
473public:
475 std::string filename,
476 int linenum,
477 std::string procname = unknownProcMsg_,
478 std::string errorMessage = "");
479 virtual ~IllegalConnectivity();
480};
481
482/////////////////////////////////////////////////////////////////////////////
483// ParserStopRequest
484/////////////////////////////////////////////////////////////////////////////
485
486/**
487 * Exception which is thrown when parser wants to tell the client that no
488 * error is found but the client should not proceed.
489 */
490class ParserStopRequest : public Exception {
491public:
493 std::string fileName,
494 int lineNum,
495 std::string procName = unknownProcMsg_,
496 std::string errorMessage = "");
497 virtual ~ParserStopRequest();
498};
499
500/////////////////////////////////////////////////////////////////////////////
501// ComponentAlreadyExists
502/////////////////////////////////////////////////////////////////////////////
503
504/**
505 * Exception which is thrown when trying to add or attach a machine
506 * component to another component and corresponding component is already
507 * attached/added.
508 */
510public:
512 std::string filename,
513 int linenum,
514 std::string procname = unknownProcMsg_,
515 std::string errorMessage = "");
516 virtual ~ComponentAlreadyExists();
517};
518
519
520/////////////////////////////////////////////////////////////////////////////
521// IllegalRegistration
522/////////////////////////////////////////////////////////////////////////////
523
524/**
525 * Exception which is thrown when an object that can be registered to (that
526 * is, owned and managed by) another object happens to have an owner that is
527 * incompatible with the operation requested. For example, an operation
528 * involving two objects could throw this exception if the objects are
529 * registered to different owners.
530 */
531class IllegalRegistration : public InvalidData {
532public:
534 std::string filename,
535 int linenum,
536 std::string procname = unknownProcMsg_,
537 std::string errorMessage = "");
538 virtual ~IllegalRegistration();
539};
540
541
542/////////////////////////////////////////////////////////////////////////////
543// ObjectStateLoadingException
544/////////////////////////////////////////////////////////////////////////////
545
546/**
547 * An exception which is thrown by Serializable::loadState if the loading
548 * failed for some reason.
549 */
551public:
553 std::string filename,
554 int linenum,
555 std::string procname = unknownProcMsg_,
556 std::string errorMessage = "");
558};
559
560
561/////////////////////////////////////////////////////////////////////////////
562// NonexistingChild
563/////////////////////////////////////////////////////////////////////////////
564
565/**
566 * Exception thrown when no child object is found in a graph or tree-like
567 * structure where each node can have several child nodes.
568 */
569class NonexistingChild : public IllegalParameters {
570public:
572 std::string filename,
573 int linenum,
574 std::string procname = unknownProcMsg_,
575 std::string errorMessage = "");
576 virtual ~NonexistingChild();
577};
578
579/////////////////////////////////////////////////////////////////////////////
580// DynamicLibraryException
581/////////////////////////////////////////////////////////////////////////////
582
583/**
584 * Exception which is thrown when errors occurred when handling dynamic
585 * libraries.
586 */
587class DynamicLibraryException : public Exception {
588public:
590 std::string filename,
591 int linenum,
592 std::string procname = unknownProcMsg_,
593 std::string errorMessage = "");
594 virtual ~DynamicLibraryException();
595};
596
597/////////////////////////////////////////////////////////////////////////////
598// MultipleInstancesFound
599/////////////////////////////////////////////////////////////////////////////
600
601/**
602 * Exception which is thrown when multiple instances of some kind are found.
603 */
604class MultipleInstancesFound : public Exception {
605public:
607 std::string filename,
608 int linenum,
609 std::string procname = unknownProcMsg_,
610 std::string errorMessage = "");
611 virtual ~MultipleInstancesFound();
612};
613
614
615/////////////////////////////////////////////////////////////////////////////
616// SymbolNotFound
617/////////////////////////////////////////////////////////////////////////////
618
619/**
620 * Exception which is thrown when symbol is not found.
621 */
622class SymbolNotFound : public Exception {
623public:
625 std::string filename,
626 int linenum,
627 std::string procname = unknownProcMsg_,
628 std::string errorMessage = "");
629 virtual ~SymbolNotFound();
630};
631
632/////////////////////////////////////////////////////////////////////////////
633// ObjectNotInitialized
634/////////////////////////////////////////////////////////////////////////////
635
636/**
637 * Exception which is thrown when object is not properly initialized.
638 */
639class ObjectNotInitialized : public Exception {
640public:
642 std::string filename,
643 int linenum,
644 std::string procname = unknownProcMsg_,
645 std::string errorMessage = "");
646 virtual ~ObjectNotInitialized();
647};
648
649/////////////////////////////////////////////////////////////////////////////
650// ScriptExecutionFailure
651/////////////////////////////////////////////////////////////////////////////
652
653/**
654 * Exception which is thrown when script execution fails.
655 */
656class ScriptExecutionFailure : public Exception {
657public:
659 std::string filename,
660 int linenum,
661 std::string procname = unknownProcMsg_,
662 std::string errorMessage = "");
663 virtual ~ScriptExecutionFailure();
664};
665
666
667/////////////////////////////////////////////////////////////////////////////
668// SerializerException
669/////////////////////////////////////////////////////////////////////////////
670
671/**
672 * Exception which is thrown by serializers when some error occurs.
673 */
674class SerializerException : public Exception {
675public:
677 std::string fileName,
678 int lineNum,
679 std::string procName = unknownProcMsg_,
680 std::string errorMessage = "");
681 virtual ~SerializerException();
682};
683
684/////////////////////////////////////////////////////////////////////////////
685// RelationalDBException
686/////////////////////////////////////////////////////////////////////////////
687
688/**
689 * Exception which is thrown by methods that handle relational databases.
690 */
691class RelationalDBException : public Exception {
692public:
694 std::string fileName,
695 int lineNum,
696 std::string procName = unknownProcMsg_,
697 std::string errorMessage = "");
698 virtual ~RelationalDBException();
699};
700
701
702/////////////////////////////////////////////////////////////////////////////
703// StartTooLate
704/////////////////////////////////////////////////////////////////////////////
705
706/**
707 * Exception which is thrown when pipeline does not start at cycle 0 or 1.
708 */
709class StartTooLate : public InvalidData {
710public:
712 std::string fileName,
713 int lineNum,
714 std::string procName = unknownProcMsg_,
715 std::string errorMessage = "");
716 virtual ~StartTooLate();
717};
718
719
720/////////////////////////////////////////////////////////////////////////////
721// NotAvailable
722/////////////////////////////////////////////////////////////////////////////
723
724/**
725 * Exception which is thrown when something is not available.
726 */
727class NotAvailable : public InvalidData {
728public:
730 std::string fileName,
731 int lineNum,
732 std::string procName = unknownProcMsg_,
733 std::string errorMessage = "");
734 virtual ~NotAvailable();
735};
736
737/////////////////////////////////////////////////////////////////////////////
738// CannotEstimateCost
739/////////////////////////////////////////////////////////////////////////////
740
741/**
742 * Exception which is thrown when cost estimator is unable to estimate
743 * a cost for given machine/machine part.
744 *
745 * Such case is usually due to missing cost data for the given machine part.
746 */
747class CannotEstimateCost : public NotAvailable {
748public:
750 std::string fileName,
751 int lineNum,
752 std::string procName = unknownProcMsg_,
753 std::string errorMessage = "");
754 virtual ~CannotEstimateCost();
755};
756
757
758/////////////////////////////////////////////////////////////////////////////
759// WrongOperandType
760/////////////////////////////////////////////////////////////////////////////
761
762/**
763 * Exception which is thrown when tried to use input operand as output or
764 * vice versa.
765 */
766class WrongOperandType : public IllegalParameters {
767public:
769 std::string fileName,
770 int lineNum,
771 std::string procName = unknownProcMsg_,
772 std::string errorMessage = "");
773 virtual ~WrongOperandType();
774};
775
776
777/////////////////////////////////////////////////////////////////////////////
778// BadOperationModule
779/////////////////////////////////////////////////////////////////////////////
780
781/**
782 * Exception which is thrown when operation module is somehow invalid.
783 */
784class BadOperationModule : public InvalidData {
785public:
787 std::string fileName,
788 int lineNum,
789 std::string procName = unknownProcMsg_,
790 std::string errorMessage = "");
791 virtual ~BadOperationModule();
792};
793
794
795/////////////////////////////////////////////////////////////////////////////
796// TypeMismatch
797/////////////////////////////////////////////////////////////////////////////
798
799/**
800 * Exception which is thrown when types mismatch.
801 */
802class TypeMismatch : public InvalidData {
803public:
805 std::string fileName,
806 int lineNum,
807 std::string procName = unknownProcMsg_,
808 std::string errorMessage = "");
809 virtual ~TypeMismatch();
810};
811
812
813/////////////////////////////////////////////////////////////////////////////
814// InvalidName
815/////////////////////////////////////////////////////////////////////////////
816
817/**
818 * Exception thrown when a string of characters that represents a name
819 * does not conform to the expected constraints. Typical lexical constraints
820 * are clashings with reserved names (keywords) and presence of illegal
821 * characters. A structural constraint may be the presence (for example, a
822 * single, mandatory dot `.' to separate the basename from the extension)
823 * and the order of expected characters (for example, a digit not allowed in
824 * first position).
825 */
826class InvalidName : public InvalidData {
827public:
829 std::string fileName,
830 int lineNum,
831 std::string procName = unknownProcMsg_,
832 std::string errorMessage = "");
833 virtual ~InvalidName();
834};
835
836/////////////////////////////////////////////////////////////////////////////
837// IllegalBehavior
838/////////////////////////////////////////////////////////////////////////////
839
840/**
841 * Exception which is thrown when an illegal operation behavior is executed.
842 */
843class IllegalOperationBehavior : public Exception {
844public:
846 std::string fileName,
847 int lineNum,
848 std::string procName = unknownProcMsg_,
849 std::string errorMessage = "");
851};
852
853/////////////////////////////////////////////////////////////////////////////
854// NonexistingSyscall
855/////////////////////////////////////////////////////////////////////////////
856
857/**
858 * Exception which is thrown when nonexisting syscall is called.
859 */
860class NonexistingSyscall : public Exception {
861public:
863 std::string fileName,
864 int lineNum,
865 std::string procName = unknownProcMsg_,
866 std::string errorMessage = "");
867 virtual ~NonexistingSyscall();
868};
869
870/////////////////////////////////////////////////////////////////////////////
871// IllegalMachine
872/////////////////////////////////////////////////////////////////////////////
873
874/**
875 * Exception which is thrown when machine being used is somehow erroneous.
876 */
877class IllegalMachine : public InvalidData {
878public:
880 std::string fileName,
881 int lineNum,
882 std::string procName = unknownProcMsg_,
883 std::string errorMessage = "");
884 virtual ~IllegalMachine();
885};
886
887/////////////////////////////////////////////////////////////////////////////
888// IllegalProgram
889/////////////////////////////////////////////////////////////////////////////
890
891/**
892 * Exception which is thrown when program being handled is somehow erronous.
893 */
894class IllegalProgram : public InvalidData {
895public:
897 std::string fileName,
898 int lineNum,
899 std::string procName = unknownProcMsg_,
900 std::string errorMessage = "");
901 virtual ~IllegalProgram();
902};
903
904
905/////////////////////////////////////////////////////////////////////////////
906// SimulationException
907/////////////////////////////////////////////////////////////////////////////
908
909/**
910 * Base class for exceptions thrown by simulator.
911 */
912class SimulationException : public Exception {
913public:
915 std::string fileName,
916 int lineNum,
917 std::string procName = unknownProcMsg_,
918 std::string errorMessage = "");
919 virtual ~SimulationException();
920};
921
922/////////////////////////////////////////////////////////////////////////////
923// SimulationStillRunning
924/////////////////////////////////////////////////////////////////////////////
925
926/**
927 * An exception which is thrown when doing something which requires the
928 * simulation not to be in running state.
929 */
931public:
933 std::string fileName,
934 int lineNum,
935 std::string procName = unknownProcMsg_,
936 std::string errorMessage = "");
937 virtual ~SimulationStillRunning();
938};
939
940/////////////////////////////////////////////////////////////////////////////
941// SimulationExecutionError
942/////////////////////////////////////////////////////////////////////////////
943
944/**
945 * Exception which is thrown when a runtime error occurs in the simulated
946 * program.
947 *
948 * Runtime error might be, for example, illegal memory access.
949 */
951public:
953 std::string filename,
954 int linenum,
955 std::string procname = unknownProcMsg_,
956 std::string errorMessage = "");
958};
959
960/////////////////////////////////////////////////////////////////////////////
961// SimulationCycleLimitReached
962/////////////////////////////////////////////////////////////////////////////
963
964/**
965 * An exception which is thrown when simulation cycle limitation is reached.
966 */
968public:
970 std::string fileName,
971 int lineNum,
972 std::string procName = unknownProcMsg_,
973 std::string errorMessage = "");
975};
976
977/////////////////////////////////////////////////////////////////////////////
978// SimulationTimeOut
979/////////////////////////////////////////////////////////////////////////////
980
981/**
982 * An exception which is thrown when simulation cycle limitation is reached.
983 */
984class SimulationTimeOut : public Exception {
985public:
987 std::string fileName,
988 int lineNum,
989 std::string procName = unknownProcMsg_,
990 std::string errorMessage = "");
991 virtual ~SimulationTimeOut();
992};
993
994/////////////////////////////////////////////////////////////////////////////
995// ObjectAlreadyExists
996/////////////////////////////////////////////////////////////////////////////
997
998/**
999 * Exception which is thrown when something already existing is being added.
1000 */
1002public:
1004 std::string filename,
1005 int linenum,
1006 std::string procname = unknownProcMsg_,
1007 std::string errorMessage = "");
1008 virtual ~ObjectAlreadyExists();
1009};
1010
1011/////////////////////////////////////////////////////////////////////////////
1012// CompileError
1013/////////////////////////////////////////////////////////////////////////////
1014
1015/**
1016 * Exception which is thrown when there is error in compilation.
1017 */
1018class CompileError : public Exception {
1019public:
1021 std::string filename,
1022 int linenum,
1023 std::string procname = unknownProcMsg_,
1024 std::string errorMessage = "");
1025
1026 virtual ~CompileError();
1027
1029 int codeFileLineNumber();
1030
1031private:
1032 int codeLineNumber_;
1033};
1034
1035///////////////////////////////////////////////////////////////////////////////
1036// ModuleRunTimeError
1037///////////////////////////////////////////////////////////////////////////////
1038
1039/**
1040 * Base class for handling run-time errors in plugin modules.
1041 */
1042class ModuleRunTimeError : public Exception {
1043public:
1045 std::string filename, int linenum,
1046 std::string procname = unknownProcMsg_,
1047 std::string errorMessage = "");
1048 virtual ~ModuleRunTimeError() {};
1049};
1050
1051///////////////////////////////////////////////////////////////////////////////
1052// NoKnownConversion
1053///////////////////////////////////////////////////////////////////////////////
1054/**
1055 * Exception which is thrown when conversion of from a type to another can not
1056 * be resolved or there are no known mapping of a variable to another.
1057 */
1058class NoKnownConversion : public InvalidData {
1059public:
1061 std::string filename, int linenum,
1062 std::string procname = unknownProcMsg_,
1063 std::string errorMessage = "");
1064 virtual ~NoKnownConversion() {};
1065};
1066
1067#include "Exception.icc"
1068
1069#endif
virtual ~BadOperationModule()
virtual ~CannotEstimateCost()
void setCodeFileLineNumber(int lineNum)
virtual ~CompileError()
int codeFileLineNumber()
virtual ~ComponentAlreadyExists()
Definition Exception.cc:709
virtual ~DynamicLibraryException()
Definition Exception.cc:820
virtual ~EndOfFile()
Definition Exception.cc:271
virtual ~ErrorInExternalFile()
Definition Exception.cc:524
static const std::string unknownProcMsg_
Used when no procedure name is given.
Definition Exception.hh:70
std::string fileName() const
std::string errorMessage() const
Definition Exception.cc:123
int lineNum() const
virtual ~FileNotFound()
Definition Exception.cc:325
virtual ~IOException()
Definition Exception.hh:136
virtual ~IllegalCommandLine()
Definition Exception.cc:602
virtual ~IllegalConnectivity()
Definition Exception.cc:656
virtual ~IllegalMachine()
virtual ~IllegalOperationBehavior()
virtual ~IllegalParameters()
Definition Exception.hh:119
virtual ~IllegalProgram()
virtual ~IllegalRegistration()
Definition Exception.cc:737
virtual ~InstanceNotFound()
Definition Exception.cc:418
virtual ~InvalidData()
Definition Exception.hh:155
virtual ~InvalidName()
virtual ~KeyAlreadyExists()
Definition Exception.hh:274
virtual ~KeyNotFound()
Definition Exception.hh:291
virtual ~MissingKeys()
Definition Exception.cc:550
virtual ~ModuleRunTimeError()
virtual ~MultipleInstancesFound()
Definition Exception.cc:847
virtual ~NoKnownConversion()
virtual ~NonexistingChild()
Definition Exception.cc:793
virtual ~NonexistingSyscall()
virtual ~NotAvailable()
virtual ~NotChunkable()
Definition Exception.hh:359
virtual ~NumberFormatException()
Definition Exception.cc:576
virtual ~ObjectAlreadyExists()
virtual ~ObjectNotInitialized()
Definition Exception.cc:902
virtual ~ObjectStateLoadingException()
Definition Exception.cc:765
virtual ~OutOfRange()
Definition Exception.hh:326
virtual ~ParserStopRequest()
Definition Exception.cc:682
virtual ~PathNotFound()
Definition Exception.cc:353
std::string path() const
std::string path_
Definition Exception.hh:255
virtual ~RelationalDBException()
Definition Exception.cc:984
virtual ~ScriptExecutionFailure()
Definition Exception.cc:929
virtual ~SerializerException()
Definition Exception.cc:957
virtual ~SimulationException()
virtual ~SimulationExecutionError()
virtual ~SimulationStillRunning()
virtual ~SimulationTimeOut()
virtual ~StartTooLate()
virtual ~SymbolNotFound()
Definition Exception.cc:875
virtual ~TypeMismatch()
virtual ~UnexpectedValue()
Definition Exception.cc:628
virtual ~UnreachableStream()
Definition Exception.cc:244
virtual ~UnresolvedReference()
Definition Exception.hh:376
virtual ~WritePastEOF()
Definition Exception.cc:299
virtual ~WrongOperandType()
virtual ~WrongSubclass()
Definition Exception.hh:342