- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Utils/Exceptions/DisallowedMutationException.cpp

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #include "DisallowedMutationException.h"
    00015 using std::endl;
    00016
    00017 using Mers::Utils::Exceptions::DisallowedMutationException;
    00018 using Mers::Utils::Lang::String;
    00019
    00021 // Construction/Destruction
    00023
    00024 DisallowedMutationException::DisallowedMutationException(
    00025   const char* variable, const char * fileName, unsigned int lineNumber)
    00026         throw()
    00027 {
    00028         String s;
    00029         // Sufficient amount of space that no number can be larger.
    00030         char val[100];
    00031
    00032         if(fileName != NULL){
    00033                 s = fileName;
    00034                 s += '(';
    00035                 sprintf(val, "%u", lineNumber);
    00036                 s += val;
    00037                 s += "): ";
    00038         }
    00039
    00040         s += "Disallowed mutation of the variable ";
    00041         s += variable;
    00042
    00043         setMessage(s);
    00044 }
    00045
    00047
    00048 DisallowedMutationException::~DisallowedMutationException() throw()
    00049 {
    00050
    00051 }
    00052
    00054