[mapguide-commits] r6322 - in sandbox/adsk/vik/Common:
CoordinateSystem Foundation Foundation/Data
Foundation/Exception Foundation/System Geometry
Geometry/Buffer Geometry/CoordinateSystem Geometry/Parse
Geometry/Spatial
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Thu Dec 8 15:58:31 EST 2011
Author: traianstanev
Date: 2011-12-08 12:58:31 -0800 (Thu, 08 Dec 2011)
New Revision: 6322
Removed:
sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.cpp
sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.h
sandbox/adsk/vik/Common/Foundation/System/ArgumentPacket.h
sandbox/adsk/vik/Common/Foundation/System/BasicPacket.h
sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.cpp
sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.h
sandbox/adsk/vik/Common/Foundation/System/ByteSourceImpl.h
sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.cpp
sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.h
sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp
sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.h
sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.cpp
sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.h
sandbox/adsk/vik/Common/Foundation/System/ClassFactory.cpp
sandbox/adsk/vik/Common/Foundation/System/ClassFactory.h
sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.cpp
sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.h
sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.cpp
sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.h
sandbox/adsk/vik/Common/Foundation/System/ControlPacket.h
sandbox/adsk/vik/Common/Foundation/System/OperationPacket.h
sandbox/adsk/vik/Common/Foundation/System/OperationResponsePacket.h
sandbox/adsk/vik/Common/Foundation/System/PacketParser.cpp
sandbox/adsk/vik/Common/Foundation/System/PacketParser.h
sandbox/adsk/vik/Common/Foundation/System/PacketStructure.h
sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.cpp
sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.h
sandbox/adsk/vik/Common/Foundation/System/Stream.cpp
sandbox/adsk/vik/Common/Foundation/System/Stream.h
sandbox/adsk/vik/Common/Foundation/System/StreamData.cpp
sandbox/adsk/vik/Common/Foundation/System/StreamData.h
sandbox/adsk/vik/Common/Foundation/System/StreamHeader.h
sandbox/adsk/vik/Common/Foundation/System/StreamHelper.cpp
sandbox/adsk/vik/Common/Foundation/System/StreamHelper.h
sandbox/adsk/vik/Common/Foundation/System/StreamParser.cpp
sandbox/adsk/vik/Common/Foundation/System/StreamParser.h
sandbox/adsk/vik/Common/Foundation/System/StreamReader.cpp
sandbox/adsk/vik/Common/Foundation/System/StreamReader.h
sandbox/adsk/vik/Common/Foundation/System/StreamWriter.cpp
sandbox/adsk/vik/Common/Foundation/System/StreamWriter.h
Modified:
sandbox/adsk/vik/Common/CoordinateSystem/CoordSys.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCatalog.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategory.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatum.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatumDictionary.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionary.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryBase.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoid.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnum.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCategory.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysFormatConverter.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGrids.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMacro.h
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMeasure.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMgrs.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysProjectionInformation.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysTransform.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUnitInformation.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUtil.cpp
sandbox/adsk/vik/Common/CoordinateSystem/CoordSysWktFailureCache.cpp
sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.cpp
sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.h
sandbox/adsk/vik/Common/CoordinateSystem/MentorUtil.cpp
sandbox/adsk/vik/Common/Foundation/Data/NamedCollection.cpp
sandbox/adsk/vik/Common/Foundation/Data/NullableProperty.cpp
sandbox/adsk/vik/Common/Foundation/Data/Property.cpp
sandbox/adsk/vik/Common/Foundation/Data/PropertyDefinition.cpp
sandbox/adsk/vik/Common/Foundation/Data/StringCollection.cpp
sandbox/adsk/vik/Common/Foundation/Exception/Exception.cpp
sandbox/adsk/vik/Common/Foundation/Exception/Exception.h
sandbox/adsk/vik/Common/Foundation/Exception/ExceptionDefs.h
sandbox/adsk/vik/Common/Foundation/Foundation.h
sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj
sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj.filters
sandbox/adsk/vik/Common/Foundation/System/Disposable.cpp
sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.cpp
sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.h
sandbox/adsk/vik/Common/Foundation/System/FileUtil.cpp
sandbox/adsk/vik/Common/Foundation/System/GuardDisposable.cpp
sandbox/adsk/vik/Common/Foundation/System/Util.cpp
sandbox/adsk/vik/Common/Foundation/System/Util.h
sandbox/adsk/vik/Common/Geometry/AgfStream.cpp
sandbox/adsk/vik/Common/Geometry/AgfStream.h
sandbox/adsk/vik/Common/Geometry/Buffer/MgBuffer.cpp
sandbox/adsk/vik/Common/Geometry/Buffer/oobject.cpp
sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemCache.cpp
sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
sandbox/adsk/vik/Common/Geometry/CurvePolygon.cpp
sandbox/adsk/vik/Common/Geometry/CurveString.cpp
sandbox/adsk/vik/Common/Geometry/Envelope.cpp
sandbox/adsk/vik/Common/Geometry/GeometricEntity.cpp
sandbox/adsk/vik/Common/Geometry/Geometry.cpp
sandbox/adsk/vik/Common/Geometry/LineString.cpp
sandbox/adsk/vik/Common/Geometry/LinearRing.cpp
sandbox/adsk/vik/Common/Geometry/LinearSegment.cpp
sandbox/adsk/vik/Common/Geometry/Parse/Array.h
sandbox/adsk/vik/Common/Geometry/Parse/ArrayHelper.cpp
sandbox/adsk/vik/Common/Geometry/Parse/LexAwkt.cpp
sandbox/adsk/vik/Common/Geometry/Parse/ParseAwkt.cpp
sandbox/adsk/vik/Common/Geometry/Parse/ParseAwktUtil.cpp
sandbox/adsk/vik/Common/Geometry/Polygon.cpp
sandbox/adsk/vik/Common/Geometry/Spatial/MathUtility.cpp
sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtility.cpp
sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp
Log:
Changed the MgException constructor to take a single string message parameter. Updated all places that throw exceptions to use the new constructor. The size of the resulting library is now 1.5 megs, down from 2.9 -- a reduction entirely due to the simplification of exception throwing.
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSys.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSys.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSys.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -117,7 +117,7 @@
assert(bResult);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return;
}
@@ -151,7 +151,7 @@
Ptr<MgDisposable> disposableCsObject = datumMapIterator->second;
MgCoordinateSystemDatum* datumInfo = dynamic_cast<MgCoordinateSystemDatum*>(disposableCsObject.p);
if (NULL == datumInfo)
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
pDatum = SAFE_ADDREF(datumInfo);
}
@@ -162,14 +162,14 @@
Ptr<MgCoordinateSystemDatumDictionary> pDtDict = m_pCatalog->GetDatumDictionary();
if (!pDtDict)
{
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDatumDictionaryException");
}
pDatum = pDtDict->Get(sDtName);
assert(pDatum);
if (!pDatum)
{
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumInDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDatumInDictionaryException");
}
}
@@ -193,7 +193,7 @@
Ptr<MgDisposable> disposableCsObject = ellipsoidMapIterator->second;
MgCoordinateSystemEllipsoid* ellipsoidInfo = dynamic_cast<MgCoordinateSystemEllipsoid*>(disposableCsObject.p);
if (NULL == ellipsoidInfo)
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
pEllipsoid = SAFE_ADDREF(ellipsoidInfo);
}
@@ -205,14 +205,14 @@
Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict = m_pCatalog->GetEllipsoidDictionary();
if (!pElDict)
{
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoEllipsoidDictionaryException");
}
pEllipsoid = pElDict->Get(sElName);
assert(pEllipsoid);
if (!pEllipsoid)
{
- throw new MgException(L"MgCoordinateSystem.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidInDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoEllipsoidInDictionaryException");
}
}
@@ -291,7 +291,7 @@
else
{
// What dimension is this?
- throw new MgException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
return pCoordinate;
@@ -327,7 +327,7 @@
else
{
// What dimension is this?
- throw new MgException(L"MgCoordinateSystem.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
return pCoordinate;
@@ -378,7 +378,7 @@
{
if((NULL == coord1) || (NULL == coord2))
{
- throw new MgException(L"MgCoordinateSystem.MeasureEuclideanDistance", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
return MeasureEuclideanDistance(coord1->GetX(), coord1->GetY(), coord2->GetX(), coord2->GetY());
@@ -431,7 +431,7 @@
{
if((NULL == coord1) || (NULL == coord2))
{
- throw new MgException(L"MgCoordinateSystem.MeasureGreatCircleDistance", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
return MeasureGreatCircleDistance(coord1->GetX(), coord1->GetY(), coord2->GetX(), coord2->GetY());
@@ -466,7 +466,7 @@
// and there must be a Great Circle path between the points.
if(GetType() == MgCoordinateSystemType::Arbitrary)
{
- throw new MgException(L"MgCoordinateSystem.MeasureGreatCircleDistance", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMustNotBeArbitrary", NULL);
+ throw new MgException(L"MgCoordinateSystemMustNotBeArbitrary");
}
Ptr<MgCoordinate> pLonLat1=ConvertToLonLat(x1, y1);
@@ -503,7 +503,7 @@
{
if((NULL == coord1) || (NULL == coord2))
{
- throw new MgException(L"MgCoordinateSystem.GetAzimuth", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
return GetAzimuth(coord1->GetX(), coord1->GetY(), coord2->GetX(), coord2->GetY());
@@ -587,7 +587,7 @@
{
if(NULL == coord)
{
- throw new MgException(L"MgCoordinateSystem.GetCoordinate", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
return GetCoordinate(coord->GetX(), coord->GetY(), azimuth, distance);
@@ -745,12 +745,12 @@
if (!m_pCatalog)
{
- throw new MgException(L"MgCoordinateSystem.ToString", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemFormatConverter> pConverter=m_pCatalog->GetFormatConverter();
if (!pConverter)
{
- throw new MgException(L"MgCoordinateSystem.ToString", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
sWkt=pConverter->DefinitionToWkt(this, MgCoordinateSystemWktFlavor::Ogc);
@@ -787,7 +787,7 @@
//Can't change read-only items
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
//Make sure the projection's been properly set
@@ -795,7 +795,7 @@
if (MgCoordinateSystemProjectionCode::Unknown == prj)
{
//Projection hasn't been properly set, so we can't set the unit type.
- throw new MgException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
//Make sure it's a unit type we know about
@@ -804,7 +804,7 @@
if (!GetUnitInfo(unit, &unitType, &dScale))
{
//Unknown unit type.
- throw new MgException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert(dScale > 0.0);
assert(MgCoordinateSystemUnitType::Unknown != unitType);
@@ -815,7 +815,7 @@
if (prjUnitType != unitType)
{
//Wrong unit type for this projection.
- throw new MgException(L"MgCoordinateSystem.SetUnitCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//Okay, we're all set. Copy in the values...
@@ -939,13 +939,13 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
if (sCode.empty())
{
//null pointer is obviously not legal...
- throw new MgException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
@@ -960,7 +960,7 @@
{
//illegal string
delete [] pStr;
- throw new MgException(L"MgCoordinateSystem.SetCsCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Copy into the definition
@@ -1016,13 +1016,13 @@
if (Protected())
{
//Can't change read-only items
- throw new MgException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
if (MgCoordinateSystemProjectionCode::Unknown==prjType)
{
//cs_UNKWN_PROJ
- throw new MgException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Set the projection string
@@ -1031,7 +1031,7 @@
if (!kpProj)
{
//cs_UNKWN_PROJ
- throw new MgException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//if same as the existing projection, do nothing
@@ -1049,7 +1049,7 @@
if (!pp)
{
//cs_UNKWN_PROJ
- throw new MgException(L"MgCoordinateSystem.SetProjectionCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
m_csprm.prj_code = pp->code;
m_csprm.prj_flags = pp->flags;
@@ -1287,13 +1287,13 @@
Ptr<MgCoordinateSystemCategoryDictionary> pCtDict=m_pCatalog->GetCategoryDictionary();
if (!pCtDict)
{
- throw new MgException(L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoCategoryDictionaryException");
}
//get the category dictionary pointer
Ptr<MgCoordinateSystemEnum> pEnumCategories=pCtDict->GetEnum();
if (!pEnumCategories)
{
- throw new MgException(L"MgCoordinateSystem.GetCategories", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
pCategoryNames = new MgStringCollection();
@@ -1399,7 +1399,7 @@
assert(NULL != pCatalog);
if (NULL == pCatalog)
{
- throw new MgException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//First, make sure it's valid in its own right; if it's
@@ -1429,7 +1429,7 @@
Ptr<MgCoordinateSystemDatumDictionary> pDtDict=pCatalog->GetDatumDictionary();
if (!pDtDict)
{
- throw new MgException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDatumDictionaryException");
}
//Build a wchar_t* from the datum name
@@ -1450,7 +1450,7 @@
Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict=pCatalog->GetEllipsoidDictionary();
if (!pElDict)
{
- throw new MgException(L"MgCoordinateSystem.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoEllipsoidDictionaryException");
}
//Build a wchar_t* from the ellipsoid name
@@ -1474,7 +1474,7 @@
assert(NULL != pDef);
if (NULL == pDef)
{
- throw new MgException(L"MgCoordinateSystem.IsSameAs", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
int i;
@@ -1492,7 +1492,7 @@
bool bResult = BuildCsDefFromInterface(pCsDef, def);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystem.IsSameAs", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//And compare with this one!
@@ -1850,7 +1850,7 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
//Projection type hasn't been properly initialized.
- throw new MgException(L"MgCoordinateSystem.GetProjectionParamCount", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
// Now for each possible parameter.
@@ -1880,7 +1880,7 @@
//Make sure the parameter is in the valid range
if ((nIndex < 1) || (nIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Make sure that this parameter is used by this projection
@@ -1888,7 +1888,7 @@
if (MgCoordinateSystemProjectionCode::Unknown == prj)
{
//Projection type hasn't been properly initialized.
- throw new MgException(L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
short prjCode = prj;
//The following function call returns 1 if this
@@ -1902,7 +1902,7 @@
if (1 != nResult)
{
//The parameter isn't used.
- throw new MgException(L"MgCoordinateSystem.GetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//The parameter is used. Return it.
@@ -1926,13 +1926,13 @@
//Can't change read-only items
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
//Make sure the parameter is in the valid range
if ((nIndex < 1) || (nIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Make sure this parameter is used by this projection
@@ -1940,7 +1940,7 @@
if (MgCoordinateSystemProjectionCode::Unknown == prj)
{
//Projection type hasn't been properly initialized.
- throw new MgException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
struct cs_Prjprm_ info;
short prjCode = prj;
@@ -1956,7 +1956,7 @@
{
//The specified parameter isn't used by this
//projection.
- throw new MgException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//Okay, at this point we know our projection type
@@ -1967,7 +1967,7 @@
if ((dValue < info.min_val) || (dValue > info.max_val))
{
//They've given us an illegal value!
- throw new MgException(L"MgCoordinateSystem.SetProjectionParameter", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Okay, the value they've given us is legitimate, too.
@@ -1995,7 +1995,7 @@
//Make sure we're not read-only
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.SetOriginLongitude", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
m_csprm.csdef.org_lng = dOrgLng;
@@ -2018,7 +2018,7 @@
//Make sure we're not read-only
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.SetOriginLatitude", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
m_csprm.csdef.org_lat = dOrgLat;
@@ -2044,7 +2044,7 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetOffsets", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
m_csprm.csdef.x_off = dXOffset;
@@ -2075,7 +2075,7 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetScaleReduction", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
INT32 prj = ProjectionFromString(m_csprm.csdef.prj_knm);
if (ProjectionUsesSclRed(prj))
@@ -2100,7 +2100,7 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetMapScale", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
m_csprm.csdef.map_scl = dMapScale;
@@ -2128,7 +2128,7 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetZeroes", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
m_csprm.csdef.zero[0] = (dXZero < 0.0)? 0.0 : dXZero;
@@ -2178,7 +2178,7 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetLonLatBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
OrderMinMax(dLonMin, dLonMax);
@@ -2204,7 +2204,7 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.CancelLonLatBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
//it will only be set on CsMap's transformation struct, i.e.
@@ -2225,7 +2225,7 @@
//Make sure we're not read-only
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.SetXYBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
OrderMinMax(dXMin, dXMax);
@@ -2245,7 +2245,7 @@
//Make sure we're not read-only
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.CancelXYBounds", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
m_csprm.min_xy[0] = 0.0;
@@ -2270,12 +2270,12 @@
//Make sure we're not read-only
if (Protected())
{
- throw new MgException(L"MgCoordinateSystem.SetQuadrant", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
if ((sQuad < -4) || (sQuad > 4) || (0 == sQuad))
{
- throw new MgException(L"MgCoordinateSystem.SetQuadrant", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
m_csprm.csdef.quad = sQuad;
@@ -2310,16 +2310,16 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
//no DT or EL if NERTH projection is used
if (ProjectionIsNerthType (GetProjectionCode()))
{
- throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDatumIfArbitraryException");
}
if (!IsLegalMentorName(sDatum.c_str()))
{
- throw new MgInvalidArgumentException(L"MgCoordinateSystem.SetDatum", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"InvalidArgument");
}
char *pStr = Convert_Wide_To_Ascii(sDatum.c_str()); //need to delete[] pStr
@@ -2333,12 +2333,12 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
//no DT or EL if NERTH projection is used
if (ProjectionIsNerthType (GetProjectionCode()))
{
- throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDatumIfArbitraryException");
}
if (!IsLegalMentorName(sEllipsoid.c_str()))
{
@@ -2376,7 +2376,7 @@
if (!pDatum)
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//if we check the protection, we can never setup any system since all systems
//are built via void CCoordinateSystem::InitFromCatalog(const cs_Csdef_& csdef)
@@ -2384,14 +2384,14 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgCoordinateSystemInitializationFailedException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
*/
//no DT or EL if NERTH projection is used
if (ProjectionIsNerthType (GetProjectionCode()))
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDatumIfArbitraryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDatumIfArbitraryException");
}
//Get information out of the datum def
@@ -2399,7 +2399,7 @@
bool bResult = BuildDtDefFromInterface(pDatum, dtdef);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//If the coordinate system is not geodetic we need to switch it
@@ -2427,7 +2427,7 @@
|| (0 != CS_nampp(dtdef.key_nm))
|| (0 != CS_stricmp(m_csprm.csdef.dat_knm, dtdef.key_nm)))
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//Get information out of the ellipsoid def
@@ -2435,13 +2435,13 @@
assert(pEllipsoid);
if (!pEllipsoid)
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
cs_Eldef_ eldef;
bResult = BuildElDefFromInterface(pEllipsoid, eldef);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//Okay, at this point we have a cs_Csdef_, cs_Dtdef_, and cs_Eldef_
@@ -2452,7 +2452,7 @@
CriticalClass.Leave();
if (NULL == pCsprm)
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
}
//Everything worked okay! Copy the data into our member variables.
@@ -2461,7 +2461,7 @@
Ptr<MgCoordinateSystemDatum> pDatumClone = pDatum->CreateClone();
if (NULL == pDatumClone.p)
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
m_pDatum = pDatumClone;
@@ -2471,7 +2471,7 @@
//Make sure the coordinate system is valid
if (!IsValid())
{
- throw new MgException(L"MgCoordinateSystem.SetDatumDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
MG_CATCH(L"MgCoordinateSystem.SetDatumDefinition")
@@ -2529,7 +2529,7 @@
if (!pEllipsoid)
{
//We were given an uninitialized datum.
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//if we check the protection, we can never setup any system since all systems
//are built via void CCoordinateSystem::InitFromCatalog(const cs_Csdef_& csdef)
@@ -2537,14 +2537,14 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
*/
//no DT or EL if NERTH projection is used
if (ProjectionIsNerthType (GetProjectionCode()))
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoEllipsoidIfArbitraryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoEllipsoidIfArbitraryException");
}
//Get information out of the Ellipsoid def
@@ -2552,7 +2552,7 @@
bool bResult = BuildElDefFromInterface(pEllipsoid, eldef);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//If the coordinate system is geodetic we need to switch it
@@ -2580,7 +2580,7 @@
|| (0 != CS_nampp(eldef.key_nm))
|| (0 != CS_stricmp(m_csprm.csdef.elp_knm, eldef.key_nm)))
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//Okay, at this point we have a valid cs_Csdef_ and cs_Eldef_.
@@ -2591,7 +2591,7 @@
CriticalClass.Leave();
if (NULL == pDatum)
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
}
CriticalClass.Enter();
@@ -2599,7 +2599,7 @@
CriticalClass.Leave();
if (NULL == pCsprm)
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
}
//We're all set. Initialize our data members.
@@ -2608,7 +2608,7 @@
Ptr<MgCoordinateSystemEllipsoid> pEllipsoidClone = pEllipsoid->CreateClone();
if (NULL == pEllipsoidClone.p)
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
m_pEllipsoid = pEllipsoidClone;
@@ -2617,7 +2617,7 @@
//Make sure the coordinate system is valid
if (!IsValid())
{
- throw new MgException(L"MgCoordinateSystem.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
MG_CATCH(L"MgCoordinateSystem.SetEllipsoidDefinition")
@@ -2684,7 +2684,7 @@
else
{
// What dimension is this?
- throw new MgException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
}
@@ -2711,7 +2711,7 @@
else
{
// What dimension is this?
- throw new MgException(L"MgCoordinateSystem.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -2823,19 +2823,19 @@
if (NULL==pDest)
{
- throw new MgException(L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
if (!IsLegalString(sSrc.c_str(), nMaxSize))
{
//Can't set string, caller gave us an illegal value
- throw new MgException(L"MgCoordinateSystem.SetString", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
@@ -2951,7 +2951,7 @@
//Make sure we've been initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystem.IsValidCoord", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
//Find out whether we're in range
@@ -2985,13 +2985,13 @@
assert(NULL != pdDestCoord2);
if (NULL == pdDestCoord1 || NULL == pdDestCoord2)
{
- throw new MgException(L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
//Do the conversion.
@@ -3011,7 +3011,7 @@
{
//The conversion failed, because we're outside the
//mathematical domain of the coordinate system.
- throw new MgException(L"MgCoordinateSystem.ConvertPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionExtentException");
}
}
@@ -3026,13 +3026,13 @@
assert(NULL != func);
if (NULL == func)
{
- throw new MgException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
//Check the range. We need to do this even if range checking
@@ -3048,7 +3048,7 @@
if (nResult & cs_CNVRT_DOMN)
{
//Outside the mathematical domain!
- throw new MgException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionExtentException");
}
//Do the conversion.
@@ -3063,7 +3063,7 @@
{
//WARNING
//should really be a warning but throwing exception
- throw new MgException(L"MgCoordinateSystem.GetDouble", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionWarningException");
}
return dResult;
@@ -3123,7 +3123,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystem.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
UINT8 nVersion=pStreamOut[0];
@@ -3159,7 +3159,7 @@
{
m_bEncrypted = bPrevEncrypted;
m_csprm.csdef = prevDef;
- throw new MgException(L"MgCoordinateSystem.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -3174,7 +3174,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystem.SerializeTo", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//save the version
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCatalog.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCatalog.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCatalog.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -230,7 +230,7 @@
if (sDir.empty())
{
fprintf(stderr, "DefaultDir for the Coordinate System library has been set but is empty.\n");
- throw new MgException(L"MgCoordinateSystemCatalog.GetDefaultDictionaryDir", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (!MgFileUtil::IsDirectory(sDir.c_str()))
@@ -241,7 +241,7 @@
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemCatalog.GetDefaultDictionaryDir", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return sDir;
@@ -266,7 +266,7 @@
{
if (sDirPath.empty())
{
- throw new MgException(L"MgCoordinateSystemCatalog.SetDictionaryDir", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
#ifdef _WIN32
@@ -366,7 +366,7 @@
|| !m_pGxDict || m_pGxDict->GetFileName().empty())
{
//Directory hasn't been specified yet.
- throw new MgException(L"MgCoordinateSystemCatalog.AreDictionaryFilesWritable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
STRING sPath=m_pElDict->GetPath();
@@ -490,7 +490,7 @@
//need to get at data files to do certain datum shifts.
if (m_sDir.empty())
{
- throw new MgException(L"MgCoordinateSystemCatalog.GetGeodeticTransformations", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
Ptr<CCoordinateSystemGeodeticTransformation> pNew = new CCoordinateSystemGeodeticTransformation(this, pSource, pTarget);
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategory.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategory.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategory.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -85,11 +85,11 @@
//make sure the file is okay
if (!pFile || -1==CS_ftell(pFile))
{
- throw new MgException(L"MgCoordinateSystemCategory.SaveToFstream", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (ferror(pFile))
{
- throw new MgException(L"MgCoordinateSystemCategory.SaveToFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
previousPosition = CS_ftell(pFile); //in case of error
@@ -140,7 +140,7 @@
if (0!=ferror(pFile) && -1!=previousPosition)
{
CS_fseek(pFile, previousPosition, SEEK_SET);
- throw new MgException(L"MgCoordinateSystemCategory.SaveToFstream", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
}
MG_THROW()
}
@@ -168,11 +168,11 @@
assert(pFile && CS_ftell(pFile)>=0);
if (!pFile || -1==CS_ftell(pFile))
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (ferror(pFile))
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
previousPosition = CS_ftell(pFile); //in case of error
@@ -192,7 +192,7 @@
_ASSERT(0 == nRead); //otherwise something else is going on here...
//we reached the end of the file
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//copy the category name into our [m_categoryName] TNameStruct
@@ -203,7 +203,7 @@
nRead=CS_fread(reinterpret_cast<char *>(&ulSize), sizeof(ulSize), 1, pFile);
if (1!=nRead)
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//Size in file.
@@ -211,12 +211,12 @@
nRead=CS_fread(reinterpret_cast<char *>(&ulMinSize), sizeof(ulMinSize), 1, pFile);
if (1!=nRead)
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
assert(ulMinSize >= ulSize);
if (ulMinSize < ulSize)
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
char keyNameBuffer[cs_KEYNM_DEF] = { '\0' };
@@ -228,7 +228,7 @@
nRead=CS_fread(keyNameBuffer, sizeof(char), expectedBufferCountRead, pFile);
if (expectedBufferCountRead != nRead)
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
member = keyNameBuffer;
@@ -250,7 +250,7 @@
}
if (ferror(pFile))
{
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//We're done! Return success.
@@ -260,7 +260,7 @@
{
CS_fseek(pFile, previousPosition, SEEK_SET);
Clear();
- throw new MgException(L"MgCoordinateSystemCategory.LoadFromFstream", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
}
MG_THROW()
}
@@ -274,7 +274,7 @@
assert(NULL != pDef);
if (!pDef)
{
- throw new MgException(L"MgCoordinateSystemCategory.CopyFrom", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
Clear();
@@ -315,7 +315,7 @@
{
if (!IsLegalName(sName))
{
- throw new MgException(L"MgCoordinateSystemCategory.SetName", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
char *pName = Convert_Wide_To_Ascii(sName.c_str()); //need to delete [] pName
@@ -352,7 +352,7 @@
//Null pointers are illegal
if (NULL == kpName)
{
- throw new MgException(L"MgCoordinateSystemCategory.IsLegalName", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//String can't be empty or too long
@@ -402,7 +402,7 @@
{
if (NULL == pDef)
{
- throw new MgException(L"MgCoordinateSystemCategory.IsSameAs", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Make sure it's a category def
@@ -540,7 +540,7 @@
if (!IsLegalMentorName(pName))
{
delete [] pName;
- throw new MgException(L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Make a new member out of it
@@ -552,7 +552,7 @@
if (itList != m_listCoordinateSystemNames.end())
{
//duplicate!
- throw new MgException(L"MgCoordinateSystemCategory.AddCoordinateSystem", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCategoryDuplicateException", NULL);
+ throw new MgException(L"MgCoordinateSystemCategoryDuplicateException");
}
//Try to insert it in our list
@@ -574,7 +574,7 @@
if (!IsLegalMentorName(pName))
{
delete [] pName;
- throw new MgException(L"MgCoordinateSystemCategory.RemoveCoordinateSystem", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Make a member out of it
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysCategoryDictionary.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -138,7 +138,7 @@
CS_fseek(pFile, sizeof(klCategoryMagic), SEEK_SET);
if (ferror(pFile))
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.GenerateIndex", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//Start reading records.
@@ -201,7 +201,7 @@
if (!pTemp || ferror(pTemp))
{
//couldn't open file
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.RewriteFile", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoCategoryDictionaryException");
}
//Copy the magic number
@@ -228,7 +228,7 @@
CS_fclose(pTemp);
CS_fclose(pFile);
pFile=NULL;
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.RewriteFile", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//Is it the one we're replacing?
@@ -257,7 +257,7 @@
CS_fclose(pFile);
pFile=NULL;
CS_fclose(pTemp);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.RewriteFile", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
}
} //until we reach the end of the original file
@@ -309,7 +309,7 @@
bWriting = true;
break;
default:
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Open", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -326,21 +326,17 @@
switch (reason)
{
case kFileInvalidEmptyString:
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Open", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
case kFileInvalidPath:
case kFileInvalidDoesNotExist:
case kFileInvalidIsADir:
{
- MgStringCollection arguments;
- arguments.Add(strPath);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Open", __LINE__, __WFILE__, &arguments, L"FileNotFound", NULL);
+ throw new MgException(L"FileNotFound: " + strPath);
}
break;
case kFileInvalidCantWrite:
- MgStringCollection arguments;
- arguments.Add(strPath);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Open", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemDictionaryReadOnlyException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryReadOnlyException: " + strPath);
break;
}
}
@@ -351,7 +347,7 @@
INT32 lDummy;
if (NULL==(pFile=OpenDictionaryFile(strPath.c_str(), szMode, lDummy, ValidCategoryMagic)))
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Open", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//And we're done! Return success.
@@ -378,9 +374,7 @@
bool bResult = IsValidDictionaryName(sFileName);
if (!bResult)
{
- MgStringCollection arguments;
- arguments.Add(sFileName);
- throw new MgException(L"MgCoordinateSystemDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + sFileName);
}
if (!sFileName.empty())
@@ -439,20 +433,20 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystemCategory* pCategoryDef=dynamic_cast<MgCoordinateSystemCategory*>(pDefinition);
if (!pCategoryDef)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//Look for it in our index
STRING str = pCategoryDef->GetName();
if (str.empty())
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
char *pName = Convert_Wide_To_Ascii(str.c_str()); //need to delete [] pName
@@ -463,7 +457,7 @@
if (iter != Index().end())
{
//Yup.
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+ throw new MgException(L"MgCoordinateSystemDuplicateException");
}
//Is it a valid def?
@@ -471,7 +465,7 @@
if (!bValid)
{
//Invalid def!
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Add", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Build a CCoordinateSystemCategory out of it.
@@ -516,7 +510,7 @@
{
MgStringCollection arguments;
arguments.Add(sName);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Remove", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException: " + sName);
}
//Rewrite the file, skipping the specified category.
@@ -543,20 +537,20 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystemCategory* pCategoryDef=dynamic_cast<MgCoordinateSystemCategory*>(pDefinition);
if (!pCategoryDef)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
//Look for it in our index
STRING str = pCategoryDef->GetName();
if (str.empty())
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
char *pName = Convert_Wide_To_Ascii(str.c_str()); //need to delete [] pName
@@ -566,9 +560,7 @@
//Did we find it?
if (iter == Index().end())
{
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException: " + str);
}
//Make a CCoordinateSystemCategory object out of what we're given
@@ -588,7 +580,7 @@
size_t nRead=CS_fread(reinterpret_cast<char *>(&ulFileSize), sizeof(ulFileSize), 1, pFile);
if (1!=nRead)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Modify", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//Can we do in-place replacement?
@@ -637,9 +629,7 @@
if (iter == Index().end())
{
//Nope.
- MgStringCollection arguments;
- arguments.Add(sName);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.GetCategory", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException: " + sName);
}
//Make a new object
@@ -724,9 +714,7 @@
bool bLegal = def.IsLegalName(sNewName);
if (!bLegal)
{
- MgStringCollection whatArguments;
- whatArguments.Add(sNewName);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, &whatArguments, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument: " + sNewName);
}
//Make sure def with old name is present
@@ -737,9 +725,7 @@
if (iter == Index().end())
{
//nope, not there
- MgStringCollection arguments;
- arguments.Add(sOldName);
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException: " + sOldName);
}
//Make sure def with new name is *not* present
@@ -747,7 +733,7 @@
if (bHas)
{
//there's already a def with that name
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+ throw new MgException(L"MgCoordinateSystemDuplicateException");
}
INT32 lMagic;
@@ -770,7 +756,7 @@
size_t nRead=CS_fread(reinterpret_cast<char *>(&ulFileSize), sizeof(ulFileSize), 1, pFile);
if (1!=nRead)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//Overwrite the def
@@ -789,7 +775,7 @@
}
catch (std::bad_alloc)
{
- throw new MgException(L"MgCoordinateSystemCategoryDictionary.Rename", __LINE__, __WFILE__, NULL, L"BadAlloc", NULL);
+ throw new MgException(L"BadAlloc");
}
CCategoryNameList::iterator iterList;
for (iterList = List().begin(); iterList != List().end(); ++iterList)
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatum.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatum.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatum.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -87,7 +87,7 @@
if (NULL == pEl.p)
{
- throw new MgException(L"MgCoordinateSystemDatum.GetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumInitializationFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumInitializationFailedException");
}
return pEl.Detach();
@@ -118,7 +118,7 @@
//Make sure the specified datum is valid
if (def.key_nm[0]=='\0')
{
- throw new MgException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//init the datum defintion part
@@ -159,7 +159,7 @@
Ptr<MgDisposable> disposableCsObject = ellipsoidsIterator->second;
MgCoordinateSystemEllipsoid* ellipsoidInfo = dynamic_cast<MgCoordinateSystemEllipsoid*>(disposableCsObject.p);
if (NULL == ellipsoidInfo)
- throw new MgException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
pEllipsoid = SAFE_ADDREF(ellipsoidInfo);
}
@@ -172,7 +172,7 @@
Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict = m_pCatalog->GetEllipsoidDictionary();
if (!pElDict)
{
- throw new MgException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumNoEllipsoidDictionaryException");
}
//load the ellipsoid defintion from the dictionary
@@ -181,7 +181,7 @@
}
if (NULL == pEllipsoid)
- throw new MgException(L"MgCoordinateSystemDatum.InitFromCatalog", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidInDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumNoEllipsoidInDictionaryException");
//Initialize from ellipsoid definitions we have
SetEllipsoidDefinition(dynamic_cast<MgCoordinateSystemEllipsoid*>(pEllipsoid.p));
@@ -228,13 +228,13 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumProtectedException");
}
if (sCode.empty())
{
//null pointer is obviously not legal...
- throw new MgException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
@@ -249,7 +249,7 @@
{
//illegal string
delete [] pStr;
- throw new MgException(L"MgCoordinateSystemDatum.SetDtCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Copy into the definitions, dtdef and cs_datum_ must be in synch
@@ -323,7 +323,7 @@
assert(NULL != pCatalog);
if (NULL == pCatalog)
{
- throw new MgException(L"MgCoordinateSystemDatum.IsUsable", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//First, make sure it's valid in its own right; if it's
@@ -341,7 +341,7 @@
Ptr<MgCoordinateSystemEllipsoidDictionary> pElDict=pCatalog->GetEllipsoidDictionary();
if (!pElDict)
{
- throw new MgException(L"MgCoordinateSystemDatum.IsUsable", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumNoEllipsoidDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumNoEllipsoidDictionaryException");
}
//Build a wchar_t* from the ellipsoid name
@@ -366,7 +366,7 @@
assert(NULL != pDef);
if (NULL == pDef)
{
- throw new MgException(L"MgCoordinateSystemDatum.IsSameAs", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Make sure it's a datum definition
@@ -380,7 +380,7 @@
cs_Dtdef_ def;
if (!BuildDtDefFromInterface(pDtDef, def))
{
- throw new MgException(L"MgCoordinateSystemDatum.IsSameAs", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"");
}
//And compare with this one!
@@ -681,13 +681,13 @@
if (Protected())
{
//can't change a read-only object
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumProtectedException");
}
//Make sure it's a legal datum name
if (!IsLegalMentorName(sEllipsoid.c_str()))
{
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoid", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert wchar_t* to C++ string
@@ -755,7 +755,7 @@
if (NULL == pEllipsoidDef)
{
//We were given an uninitialized datum.
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
STRING sEllipsoid=pEllipsoidDef->GetElCode();
@@ -763,7 +763,7 @@
//Make sure it's a legal datum name
if (!IsLegalMentorName(sEllipsoid.c_str()))
{
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert wchar_t* to C++ string
@@ -788,7 +788,7 @@
bool bResult = BuildElDefFromInterface(pEllipsoidDef, eldef);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//Make sure the datum's specified ellipsoid matches the
@@ -801,7 +801,7 @@
|| (0 != CS_nampp(eldef.key_nm))
|| (0 != CS_stricmp(m_DtDef.ell_knm, eldef.key_nm)))
{
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumMismatchException");
}
//Build a cs_Datum_ from the datum and ellipsoid definitions
@@ -810,7 +810,7 @@
CriticalClass.Leave();
if (NULL == pDatum)
{
- throw new MgException(L"MgCoordinateSystemDatum.SetEllipsoidDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumInternalException");
}
//Okay, everything succeeded. Hang on to a copy of the
@@ -858,19 +858,19 @@
assert(NULL != pDest);
if (NULL==pDest)
{
- throw new MgException(L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumProtectedException");
}
if (!IsLegalString(sSrc.c_str(), nMaxSize))
{
//Can't set string, caller gave us an illegal value
- throw new MgException(L"MgCoordinateSystemDatum.SetString", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
@@ -906,7 +906,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemDatum.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
UINT8 nVersion=pStreamOut[0];
@@ -954,7 +954,7 @@
{
m_bEncrypted = bPrevEncrypted;
m_DtDef = prevDef;
- throw new MgException(L"MgCoordinateSystemDatum.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -969,7 +969,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemDatum.SerializeTo", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//save the version
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatumDictionary.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatumDictionary.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDatumDictionary.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -330,9 +330,7 @@
bool bResult = IsValidDictionaryName(sFileName);
if (!bResult)
{
- MgStringCollection arguments;
- arguments.Add(sFileName);
- throw new MgException(L"MgCoordinateSystemDatumDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"MgInvalidArgumentException", NULL);
+ throw new MgException(L"MgInvalidArgumentException: " + sFileName);
}
MentorDictionary::SetFileName(
@@ -396,7 +394,7 @@
nSize=(ulFileBytes - sizeof(m_lMagic)) / nRecSize;
if (0!=CS_fclose(pFile))
{
- throw new MgException(L"MgCoordinateSystemDatumDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
}
return nSize;
@@ -417,13 +415,13 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemDatumDictionary.Add", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystemDatum* pDatumDef=dynamic_cast<MgCoordinateSystemDatum*>(pDefinition);
if (!pDatumDef)
{
- throw new MgException(L"MgCoordinateSystemDatumDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
MentorDictionary::UpdateDef<cs_Dtdef_, MgCoordinateSystemDatum>(
@@ -462,13 +460,13 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemDatumDictionary.Modify", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystemDatum* pDatumDef=dynamic_cast<MgCoordinateSystemDatum*>(pDefinition);
if (!pDatumDef)
{
- throw new MgException(L"MgCoordinateSystemDatumDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
MentorDictionary::UpdateDef<cs_Dtdef_, MgCoordinateSystemDatum>(
@@ -517,9 +515,7 @@
if (NULL == pDef)
{
//wasn't there!
- MgStringCollection whatArguments;
- whatArguments.Add(sName);
- throw new MgException(L"MgCoordinateSystemDatumDictionary.GetDatum", __LINE__, __WFILE__, &whatArguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + sName);
}
//Okay, at this point we have a Mentor coordsys definition
@@ -662,7 +658,7 @@
}
if (NULL == m_pmapSystemNameDescription)
{
- throw new MgException(L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -675,7 +671,7 @@
{
const bool fileClosed = (0 == CS_fclose(pFile));
if (!fileClosed && NULL == mgException) //throw this exception in case no other exception has already been caught
- mgException = new MgException(L"MgCoordinateSystemDatumDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ mgException = new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
pFile = NULL;
}
@@ -699,11 +695,11 @@
/*IN, optional*/const std::vector<MgCoordinateSystemFilter*>* const filters)
{
if (NULL == targetDictionary)
- throw new MgException(L"CCoordinateSystemDatumDictionary.ReadAllDatums", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
CCoordinateSystemDatumDictionary* datumDictionary = dynamic_cast<CCoordinateSystemDatumDictionary*>(targetDictionary);
if (NULL == datumDictionary) //everything else is an implementation defect
- throw new MgException(L"CCoordinateSystemDatumDictionary.ReadAllDatums", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//place a lock here - we don't want any interference; what we need is the *current* status of all dictionary files
SmartCriticalClass dictionaryLock(true);
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionary.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionary.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionary.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -166,8 +166,7 @@
nNameSize = sizeof(v8.key_nm);
return;
default:
- throw new MgException(
- L"GetCoordinateSystemSizeInfo", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//The following will never actually get
@@ -349,9 +348,7 @@
bool bResult = IsValidDictionaryName(sFileName);
if (!bResult)
{
- MgStringCollection arguments;
- arguments.Add(sFileName);
- throw new MgException(L"MgCoordinateSystemDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + sFileName);
}
MentorDictionary::SetFileName(
@@ -414,7 +411,7 @@
if (0!=CS_fclose(pFile))
{
- throw new MgException(L"MgCoordinateSystemDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
}
return nSize;
@@ -434,13 +431,13 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemDictionary.Add", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystem* pCoordinateSystem=dynamic_cast<MgCoordinateSystem*>(pDefinition);
if (!pCoordinateSystem)
{
- throw new MgException(L"MgCoordinateSystemDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
MentorDictionary::UpdateDef<cs_Csdef_, MgCoordinateSystem>(
@@ -478,13 +475,13 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemDictionary.Modify", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystem* pCoordinateSystem=dynamic_cast<MgCoordinateSystem*>(pDefinition);
if (!pCoordinateSystem)
{
- throw new MgException(L"MgCoordinateSystemDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
MentorDictionary::UpdateDef<cs_Csdef_, MgCoordinateSystem>(
@@ -530,9 +527,7 @@
if (NULL == pDef)
{
//wasn't there!
- MgStringCollection whatArguments;
- whatArguments.Add(sName);
- throw new MgException(L"MgCoordinateSystemDictionary.GetCoordinateSystem", __LINE__, __WFILE__, &whatArguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + sName);
}
//Okay, at this point we have a Mentor coordsys definition
@@ -623,11 +618,11 @@
/*IN, optional*/ const std::vector<MgCoordinateSystemFilter*>* const filters)
{
if (NULL == targetDictionary)
- throw new MgException(L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
CCoordinateSystemDictionary* csDictionary = dynamic_cast<CCoordinateSystemDictionary*>(targetDictionary);
if (NULL == csDictionary)
- throw new MgException(L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//in order to create the MgCoordinateSystem objects, we have to have also the information on the datums and ellipsoids
map<STRING, Ptr<MgDisposable> > ellipsoidMap;
@@ -727,7 +722,7 @@
}
if (NULL == m_pmapSystemNameDescription)
{
- throw new MgException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -736,7 +731,7 @@
if (0!=CS_fclose(pFile))
{
- throw new MgException(L"MgCoordinateSystemDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
}
pFile=NULL;
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryBase.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryBase.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryBase.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -27,7 +27,7 @@
: dictMagicNumber(0) /* no yet initialized - will be read in [SetFileName] */, dictionaryItems(NULL)
{
if (NULL == pCatalog)
- throw new MgException(L"CCoordinateSystemDictionaryBase.ctor()", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
this->catalog = SAFE_ADDREF(pCatalog); // 'Ptr = ' does not increment the ref counter
this->fileName = defaultFileName; //template default parameter
@@ -135,7 +135,7 @@
if(NULL != pFile && (0 != CS_fclose(pFile)))
{
- throw new MgException(L"CCoordinateSystemDictionaryBase.GetSize", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
MG_THROW()
@@ -149,11 +149,11 @@
{
//we won't take ownership of [pDefinition]; i.e. it can be deleted by the caller after we're done here
if (NULL == pDefinition)
- throw new MgException(L"CCoordinateSystemDictionaryBase.Add", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
T* pDictionaryDef = dynamic_cast<T*>(pDefinition);
if (!pDictionaryDef)
- throw new MgException(L"CCoordinateSystemDictionaryBase.Add", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//::UpdateDef will lock the (file) resource via [SmartCriticalClass critical(true);]
MentorDictionary::UpdateDef<U, T>(
@@ -185,11 +185,11 @@
void DICTIONARY_BASE_TEMPLATE_METHOD::Modify(MgGuardDisposable *pDefinition)
{
if (NULL == pDefinition)
- throw new MgException(L"CCoordinateSystemDictionaryBase.Modify", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
T* pDictionaryDef = dynamic_cast<T*>(pDefinition);
if (!pDictionaryDef)
- throw new MgException(L"CCoordinateSystemDictionaryBase.Modify", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//::UpdateDef will lock the (file) resource via [SmartCriticalClass critical(true);]
@@ -232,7 +232,7 @@
{
MgStringCollection whatArguments;
whatArguments.Add(sName);
- throw new MgException(L"CCoordinateSystemDictionaryBase.Get", __LINE__, __WFILE__, &whatArguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + sName);
}
pDefinition = this->NewItem(); //no AddRef; release if needed
@@ -313,7 +313,7 @@
definitionAccess->readAllDefinitions);
if (NULL == allDictionaryEntries) //whatever happend here - the dictionay file seems to be invalid
- throw new MgException(L"CCoordinateSystemDictionaryBase.GetEnumImp", __LINE__, __WFILE__, NULL, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed");
}
else
{
@@ -331,7 +331,7 @@
&& NULL == mgException.p)
//if there hasn't yet an exception occurred we now have one
//if there was one already we (unfortunately) do now swallow the MgFileIoException
- mgException = new MgException(L"CCoordinateSystemDictionaryBase.GetEnumImp", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ mgException = new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
MG_THROW()
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysDictionaryUtility.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -91,7 +91,7 @@
CS_fclose(pFile);
delete [] pDict;
//It already exists, but it's not supposed to.
- throw new MgException(L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+ throw new MgException(L"MgCoordinateSystemDuplicateException");
}
if (pFile)
{
@@ -105,7 +105,7 @@
if (1!=nWrite || ferror(pFile))
{
CS_fclose(pFile);
- throw new MgException(L"MgCoordinateSystemDictionaryUtility.CreateDictionaryFile", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//Success!
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoid.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoid.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoid.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -58,19 +58,19 @@
if (NULL==pDest)
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemEllipsoidProtectedException");
}
if (!IsLegalString(sSrc.c_str(), nMaxSize))
{
//Can't set string, caller gave us an illegal value
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetString", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
@@ -125,12 +125,12 @@
if (Protected())
{
//Can't modify a read-only object.
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemEllipsoidProtectedException");
}
if (sCode.empty())
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
@@ -145,7 +145,7 @@
{
//illegal string
delete [] pStr;
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetElCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Copy into the definition
@@ -225,7 +225,7 @@
assert(NULL != pDef);
if (NULL == pDef)
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.IsSameAs", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Make sure it's an ellipsoid definition
@@ -240,7 +240,7 @@
bool bResult = BuildElDefFromInterface(pElDef, def);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.IsSameAs", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//And compare with this one!
@@ -461,21 +461,21 @@
if (Protected())
{
//can't change a read-only object
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemEllipsoidProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemEllipsoidProtectedException");
}
//Make sure the radii are mathematically valid
if (!IsLegalEllipsoidRadius(dEquatorialRadius)
|| !IsLegalEllipsoidRadius(dPolarRadius))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Make sure the flattening ratio is legitimate
double dFlat = FlatteningRatio(dEquatorialRadius, dPolarRadius);
if (!::IsLegalFlatteningRatio(dFlat))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.SetRadii", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Okay, everything's kosher, store the values.
@@ -499,7 +499,7 @@
assert(dFlat <= 1.0);
if ((dFlat < 0.0) || (dFlat > 1.0))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.FlatteningRatioToEccentricity", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
dEccent = Eccentricity(dFlat);
@@ -520,7 +520,7 @@
assert(dEccent <= 1.0);
if ((dEccent < 0.0) || (dEccent > 1.0))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.EccentToFlat", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
dFlat = FlatteningRatio(dEccent);
@@ -541,7 +541,7 @@
assert(dFlatteningRatio < 1.0);
if ((dFlatteningRatio < 0.0) || (dFlatteningRatio >= 1.0))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.EquatorialRadiusFromPolarRadiusFlatteningRatio", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
dEquatorialRadius = dPolarRadius / (1.0 - dFlatteningRatio);
@@ -562,7 +562,7 @@
assert(dFlatteningRatio < 1.0);
if ((dFlatteningRatio < 0.0) || (dFlatteningRatio >= 1.0))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.PolarRadiusFromEquatorialRadiusFlatteningRatio", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
dPolarRadius = dEquatorialRadius * (1.0 - dFlatteningRatio);
@@ -582,7 +582,7 @@
assert(NULL != pdAzimuth);
if (NULL == pdDistance || NULL == pdAzimuth)
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.GreatCircle", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//set up our input variables
@@ -627,7 +627,7 @@
assert(NULL != pdMaxRadius);
if (NULL == pdMinRadius || NULL == pdMaxRadius)
{
- throw new MgException(L"MentorDictionary.GetRadiusBounds", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
*pdMinRadius = kdMinEllipsoidRadius;
@@ -669,7 +669,7 @@
assert(NULL != pdMaxFlat);
if (NULL == pdMinFlat || NULL == pdMaxFlat)
{
- throw new MgException(L"MentorDictionary.GetFlatteningRatioBounds", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
*pdMinFlat = kdMinEllipsoidFlat;
@@ -713,11 +713,11 @@
if (!IsLegalEllipsoidRadius(dEquatorialRadius))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.FlatteningRatioFromRadii", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (!IsLegalEllipsoidRadius(dPolarRadius))
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.FlatteningRatioFromRadii", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
dFlat = FlatteningRatio(dEquatorialRadius, dPolarRadius);
@@ -739,7 +739,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
UINT8 nVersion=pStreamOut[0];
@@ -775,7 +775,7 @@
{
m_bEncrypted = bPrevEncrypted;
m_def = prevDef;
- throw new MgException(L"MgCoordinateSystemEllipsoid.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -790,7 +790,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemEllipsoid.SerializeTo", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//save the version
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEllipsoidDictionary.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -270,9 +270,7 @@
bool bResult = IsValidDictionaryName(sFileName);
if (!bResult)
{
- MgStringCollection arguments;
- arguments.Add(sFileName);
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.SetFileName", __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + sFileName);
}
MentorDictionary::SetFileName(
@@ -333,7 +331,7 @@
nSize=(ulFileBytes - sizeof(m_lMagic)) / sizeof(cs_Eldef_);
if (0!=CS_fclose(pFile))
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.GetSize", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
}
return nSize;
@@ -354,13 +352,13 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.Add", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystemEllipsoid* pEllipsoidDef=dynamic_cast<MgCoordinateSystemEllipsoid*>(pDefinition);
if (!pEllipsoidDef)
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.Add", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
MentorDictionary::UpdateDef<cs_Eldef_, MgCoordinateSystemEllipsoid>(
@@ -403,13 +401,13 @@
assert(NULL != pDefinition);
if (NULL == pDefinition)
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.Modify", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgCoordinateSystemEllipsoid* pEllipsoidDef=dynamic_cast<MgCoordinateSystemEllipsoid*>(pDefinition);
if (!pEllipsoidDef)
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.Modify", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
MentorDictionary::UpdateDef<cs_Eldef_, MgCoordinateSystemEllipsoid>(
@@ -452,9 +450,7 @@
if (NULL == pDef)
{
//wasn't there!
- MgStringCollection whatArguments;
- whatArguments.Add(sName);
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.GetEllipsoid", __LINE__, __WFILE__, &whatArguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + sName);
}
//Okay, at this point we have a Mentor ellipsoid definition
@@ -487,7 +483,7 @@
if (NULL == pEllipsoidDef.p)
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.GetEllipsoid", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return pEllipsoidDef.Detach();
@@ -556,7 +552,7 @@
CS_elrd);
if (NULL == m_pmapSystemNameDescription)
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -565,7 +561,7 @@
if (0!=CS_fclose(pFile))
{
- throw new MgException(L"MgCoordinateSystemEllipsoidDictionary.GetEnum", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
}
pFile=NULL;
@@ -590,11 +586,11 @@
/*IN, optional*/const std::vector<MgCoordinateSystemFilter*>* const filters)
{
if (NULL == targetDictionary)
- throw new MgException(L"CCoordinateSystemEllipsoidDictionary.ReadAllEllipsoids", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
CCoordinateSystemEllipsoidDictionary* ellipsoidDictionary = dynamic_cast<CCoordinateSystemEllipsoidDictionary*>(targetDictionary);
if (NULL == ellipsoidDictionary)
- throw new MgException(L"CCoordinateSystemEllipsoidDictionary.ReadAllEllipsoids", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
return MentorDictionary::ReadAllDefinitions<MgCoordinateSystemEllipsoid, cs_Eldef_, CCoordinateSystemEllipsoidDictionary>(
ellipsoidDictionary,
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnum.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnum.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnum.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -133,9 +133,7 @@
assert(pDef);
if (!pDef)
{
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + str);
}
//is it filtered out?
@@ -226,7 +224,7 @@
if (ulSkipCount != ulSkipped)
{
- throw new MgException(L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -250,7 +248,7 @@
assert(NULL != kpName);
if (!kpName)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//If a Filter hasn't been specified, just return false.
@@ -268,9 +266,7 @@
assert(pDef);
if (!pDef)
{
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + str);
}
//Evaluate it
@@ -289,7 +285,7 @@
assert(NULL != pDef);
if (!pDef)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
for (size_t i=0; i<m_vectFilter.size(); i++)
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCategory.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCategory.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCategory.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -60,7 +60,7 @@
assert(NULL != pDef);
if (!pDef)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
for (size_t i=0; i<m_vectFilter.size(); i++)
@@ -87,7 +87,7 @@
assert(NULL != kpName);
if (!kpName)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//If a filter hasn't been specified, just return false.
@@ -105,9 +105,7 @@
assert(pDef);
if (!pDef)
{
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + str);
}
//Evaluate it
@@ -167,9 +165,7 @@
assert(pDef);
if (!pDef)
{
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + str);
}
//check if this category is filtered out or not
@@ -219,7 +215,7 @@
//----------------------------------------------------------
MgStringCollection* CCoordinateSystemEnumCategory::NextDescription(UINT32 ulCount)
{
- throw new MgException(L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
}
//----------------------------------------------------------
@@ -246,7 +242,7 @@
if (ulSkipCount != ulSkipped)
{
- throw new MgException(L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumCoordinateSystemInCategory.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -85,12 +85,12 @@
if (!m_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemDictionary> pCsDict=m_pCatalog->GetCoordinateSystemDictionary();
if (!pCsDict)
{
- throw new MgException(L"MgCoordinateSystem.Next", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDictionaryException");
}
wchar_t* pstr;
@@ -114,9 +114,7 @@
Ptr<MgGuardDisposable> pCs=pCsDict->Get(strCsName);
if (!pCs)
{
- MgStringCollection arguments;
- arguments.Add(strCsName);
- throw new MgException(L"MgCoordinateSystemEnum.Next", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + strCsName);
}
//is it filtered out?
if (IsFilteredOut(pCs))
@@ -170,12 +168,12 @@
pOutput=new MgStringCollection;
if (!m_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemDictionary> pCsDict=m_pCatalog->GetCoordinateSystemDictionary();
if (!pCsDict)
{
- throw new MgException(L"MgCoordinateSystem.NextDescription", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDictionaryException");
}
wchar_t* pstr;
@@ -198,9 +196,7 @@
Ptr<MgGuardDisposable> pCs=pCsDict->Get(strCsName);
if (!pCs)
{
- MgStringCollection arguments;
- arguments.Add(strCsName);
- throw new MgException(L"MgCoordinateSystemEnum.NextDescription", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + strCsName);
}
//is it filtered out?
if (IsFilteredOut(pCs))
@@ -243,7 +239,7 @@
if (ulSkipCount != ulSkipped)
{
- throw new MgException(L"MgCoordinateSystemEnum.Skip", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -266,7 +262,7 @@
assert(NULL != kpName);
if (!kpName)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Get a def from the set for the Filter to work with
@@ -287,7 +283,7 @@
assert(NULL != kpName);
if (!kpName)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//If a Filter hasn't been specified, just return true.
@@ -299,12 +295,12 @@
if (!m_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemDictionary> pCsDict=m_pCatalog->GetCoordinateSystemDictionary();
if (!pCsDict)
{
- throw new MgException(L"MgCoordinateSystem.IsFilteredOut", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDictionaryException");
}
//Get a def from the set for the Filter to work with
@@ -313,9 +309,7 @@
assert(pDef);
if (!pDef)
{
- MgStringCollection arguments;
- arguments.Add(str);
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + str);
}
//Evaluate it
@@ -333,7 +327,7 @@
assert(NULL != pDef);
if (!pDef)
{
- throw new MgException(L"MgCoordinateSystemEnum.IsFilteredOut", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
for (size_t i=0; i<m_vectFilter.size(); i++)
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumInteger32.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumInteger32.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysEnumInteger32.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -59,7 +59,7 @@
assert((NULL != pnValues) || (ulSize == 0));
if (!pnValues)
{
- throw new MgException(L"MgCoordinateSystemEnumInteger32.SetList", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
delete [] m_pnValues;
@@ -178,7 +178,7 @@
}
if (ulSkipCount != ulSkipped)
{
- throw new MgException(L"MgCoordinateSystemEnumInteger32.Skip", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysFormatConverter.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysFormatConverter.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysFormatConverter.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -59,18 +59,18 @@
if (pSource==NULL)
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
if (wktFlvrUnknown==GetWktFlavor(nWktFlavor))
{
//invalid argument
- throw new MgException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
bool bResult = BuildDefsFromInterface(pSource, pCsDef, pDtDef, pElDef);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.DefinitionToWkt", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
if (ProjectionIsNerthType (pCsDef->prj_knm))
@@ -157,7 +157,7 @@
Ptr<CCoordinateSystem> pNew = new CCoordinateSystem(m_pCatalog);
if (!pNew->InitArbitrary(csprm))
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"MgCoordinateSystemInitializationFailed");
}
return pNew.Detach();
}
@@ -336,7 +336,7 @@
//make a coordsys object
if (!pCsDef || !pElDef)
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//do we have a datum?
@@ -346,7 +346,7 @@
Ptr<MgCoordinateSystemDatum> pDtDef=BuildInterfaceFromDtDef(dtDef, NULL);
if (!pDtDef)
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
pDtDef->SetEllipsoidDefinition(pElDef);
pCsDef->SetDatumDefinition(pDtDef);
@@ -375,9 +375,7 @@
if (NULL == pCoordSys)
{
// Could not create the coordinate system from the WKT
- MgStringCollection arguments;
- arguments.Add(sWkt);
- throw new MgException(L"MgCoordinateSystemFormatConverter.WktToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemFailedToCreateCoordinateSystemFromWkt", &arguments);
+ throw new MgException(L"MgCoordinateSystemFailedToCreateCoordinateSystemFromWkt: " + sWkt);
}
else
{
@@ -420,7 +418,7 @@
if (wktFlvrUnknown==GetWktFlavor(nWktFlavor))
{
//invalid argument
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
std::string szMsiName;
@@ -485,7 +483,7 @@
else
{
//invalid source format
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//now get the WKT
@@ -498,9 +496,7 @@
Ptr<MgCoordinateSystem> pCsCoordinateSystemDef=GetCoordinateSystem(strMsiName);
if (!pCsCoordinateSystemDef)
{
- MgStringCollection arguments;
- arguments.Add(strMsiName);
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToWkt", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + strMsiName);
}
INT32 prj=pCsCoordinateSystemDef->GetProjectionCode();
@@ -664,7 +660,7 @@
else
{
//invalid format
- throw new MgException(L"MgCoordinateSystemFormatConverter.WktToCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
}
@@ -702,14 +698,14 @@
if (pSource==NULL)
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//get the name of the source system
STRING sCsSource=pSource->GetCsCode();
if (sCsSource.empty())
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
pszCsSource = Convert_Wide_To_Ascii(sCsSource.c_str());
@@ -752,7 +748,7 @@
else
{
//invalid format
- throw new MgException(L"MgCoordinateSystemFormatConverter.DefinitionToCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
MG_CATCH(L"MgCoordinateSystemFormatConverter.DefinitionToCode")
@@ -812,7 +808,7 @@
else
{
//invalid format
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//now get the definition
@@ -829,9 +825,7 @@
if (!pCsDestination)
{
// Could not create the coordinate system from the code
- MgStringCollection arguments;
- arguments.Add(sCodeSource);
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToDefinition", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemFailedToCreateCoordinateSystemFromCode", &arguments);
+ throw new MgException(L"MgCoordinateSystemFailedToCreateCoordinateSystemFromCode: " + sCodeSource);
}
MG_CATCH(L"MgCoordinateSystemFormatConverter.CodeToDefinition")
@@ -899,7 +893,7 @@
else
{
//invalid format
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
}
@@ -935,7 +929,7 @@
else
{
//invalid format
- throw new MgException(L"MgCoordinateSystemFormatConverter.CodeToCode", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
MG_CATCH(L"MgCoordinateSystemFormatConverter.CodeToCode")
@@ -995,7 +989,7 @@
else
{
//invalid format
- throw new MgException(L"MgCoordinateSystemFormatConverter.IsCodeInDictionary", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
return bIsPresent;
@@ -1039,9 +1033,7 @@
if (NULL == pCsDict.p)
{
- throw new MgException(
- L"MgCoordinateSystemFormatConverter.GetCoordinateSystem",
- __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoDictionaryException");
}
Ptr<MgGuardDisposable> disposableObj;
@@ -1068,7 +1060,7 @@
bool bResult=BuildCsDefFromInterface(pCsDef, def);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemFormatConverter.ConvertArbitraryToWkt", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
char* szWkt=CCsArbitraryCoordinateSystemUtil::ConvertCoordinateSystemToWkt(&def);
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticAnalyticalTransformDefParams.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -35,7 +35,7 @@
{
this->geocentricTransformParams = (csGeocentricXformParams*) CS_malc(sizeof(csGeocentricXformParams));
if (NULL == this->geocentricTransformParams)
- throw new MgException(L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.Ctor", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException(L"OutOfMemory");
*this->geocentricTransformParams = params;
}
@@ -103,7 +103,7 @@
break;
default:
- throw new MgException(L"CCoordinateSystemGeodeticAnalyticalTransformDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
this->transformationMethod = analyticalMethodCode;
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticInterpolationTransformDefParams.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -56,7 +56,7 @@
this->gridFileParams = (csGridFileXformParams*) CS_malc(sizeof(csGridFileXformParams));
if (NULL == this->gridFileParams)
- throw new MgException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.Reset", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException(L"OutOfMemory");
memset(this->gridFileParams, 0, sizeof(csGridFileXformParams));
}
@@ -79,7 +79,7 @@
ENSURE_NOT_NULL(gridFiles, L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFileNames");
const INT32 fileNamesCount = gridFiles->GetCount();
if (fileNamesCount > csGRIDI1_FILEMAX)
- throw new MgException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
bool emptyFileCollection = (0 == fileNamesCount);
csGeodeticXfromParmsFile_* allFiles = emptyFileCollection ? NULL : new csGeodeticXfromParmsFile_[fileNamesCount];
@@ -94,11 +94,11 @@
Ptr<MgDisposable> gridFile = gridFiles->GetItem(i); //calls [AddRef] on the item being returned
CCoordinateSystemGeodeticTransformGridFile* gridFileSetting = dynamic_cast<CCoordinateSystemGeodeticTransformGridFile*>(gridFile.p);
if (NULL == gridFileSetting)
- throw new MgException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//we only allow for setting valid grid files
if (!gridFileSetting->IsValid())
- throw new MgException(L"CCoordinateSystemGeodeticInterpolationTransformDefParams.SetGridFiles", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//take the values from the settings we have been passed here and set our internal
//[csGridFileXFormat] instance at index [i] to those values
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticMultipleRegressionTransformDefParams.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -57,7 +57,7 @@
this->mulRegParams = (csMultipleRegressionXformParams*) CS_malc(sizeof(csMultipleRegressionXformParams));
if (NULL == this->mulRegParams)
- throw new MgException(L"CCoordinateSystemGeodeticMultipleRegressionTransformDefParams.Reset", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException(L"OutOfMemory");
memset(this->mulRegParams, 0, sizeof(csMultipleRegressionXformParams));
}
@@ -107,7 +107,7 @@
break;
default:
- throw new MgException(L"CCoordinateSystemGeodeticMultipleRegressionTransformDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
this->transformationMethod = mulRegTransformationMethod;
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPath.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPath.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPath.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -34,7 +34,7 @@
: pathDefinition(NULL), catalog(SAFE_ADDREF(pCatalog))
{
if (NULL == pCatalog)
- throw new MgException(L"CCoordinateSystemGeodeticPath.ctor", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
CCoordinateSystemGeodeticPath::~CCoordinateSystemGeodeticPath()
@@ -62,7 +62,7 @@
this->pathDefinition = (cs_GeodeticPath_*)CS_malc(sizeof(cs_GeodeticPath_));
if (NULL == this->pathDefinition)
- throw new MgException(L"CCoordinateSystemGeodeticPath.Initialize", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException(L"OutOfMemory");
memset ((void*)this->pathDefinition, 0, sizeof(cs_GeodeticPath_));
}
@@ -155,7 +155,7 @@
const INT32 pathElementCount = pathElements->GetCount();
if (0 == pathElementCount || pathElementCount > csPATH_MAXXFRM)
- throw new MgException(L"CCoordinateSystemGeodeticPath.SetPathElements", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
cs_GeodeticPathElement_* validElements = new cs_GeodeticPathElement_[pathElementCount];
@@ -169,7 +169,7 @@
Ptr<MgDisposable> collectionItem = pathElements->GetItem(i);
MgCoordinateSystemGeodeticPathElement* pathElement = dynamic_cast<MgCoordinateSystemGeodeticPathElement*>(collectionItem.p);
if (NULL == pathElement)
- throw new MgException(L"CCoordinateSystemGeodeticPath.SetPathElements", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
cs_GeodeticPathElement_& pathElementDef = validElements[i];
@@ -214,7 +214,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
UINT8 nVersion=pStreamOut[0];
@@ -229,7 +229,7 @@
if (pathDefinition == NULL)
{
this->pathDefinition = previousPathPtr;
- throw new MgException (L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException (L"OutOfMemory");
}
memcpy(pathDefinition, pStreamOut, sizeof(cs_GeodeticPath_));
pStreamOut = pStreamOut + sizeof(cs_GeodeticPath_);
@@ -239,7 +239,7 @@
{
CS_free (this->pathDefinition);
this->pathDefinition = previousPathPtr;
- throw new MgException(L"MgCoordinateSystemGeodeticPath.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
CS_free (previousPathPtr);
}
@@ -255,7 +255,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemGeodeticPath.SerializeTo", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//save the version
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticPathElement.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -59,7 +59,7 @@
{
cs_GeodeticPathElement_* tempPathElement = (cs_GeodeticPathElement_*) CS_malc(sizeof(cs_GeodeticPathElement_));
if (NULL == tempPathElement)
- throw new MgException(L"CCoordinateSystemGeodeticPathElement.Reset", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException(L"OutOfMemory");
MG_TRY()
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticStandaloneTransformDefParams.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -76,7 +76,7 @@
break;
default:
- throw new MgException(L"CCoordinateSystemGeodeticStandaloneDefParams.SetTransformationMethod", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
this->m_nStandaloneMethodCode = standaloneMethodCode;
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformDef.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -40,7 +40,7 @@
{
//have we been passed a non-null argument?
if (NULL == this->catalog)
- throw new MgException(L"CCoordinateSystemGeodeticTransformDef.ctor", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
CCoordinateSystemGeodeticTransformDef::~CCoordinateSystemGeodeticTransformDef()
@@ -77,7 +77,7 @@
break;
default:
- throw new MgException(L"CCoordinateSystemGeodeticTransformDef.Reset", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//try creating a new [cs_GeodeticTransform_] instance before we wipe out our own stuff
@@ -157,7 +157,7 @@
break;
default: //invalid / unknown [methodCode] given; don't know how to proceed here
- throw new MgException(L"CCoordinateSystemGeodeticTransformDef.Initialize", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
return transformationType;
@@ -178,7 +178,7 @@
VERIFY_INITIALIZED(L"CCoordinateSystemGeodeticTransformDef.CreateTransformation");
if (!this->IsValid())
- throw new MgException(L"CCoordinateSystemGeodeticTransformDef.CreateTransformation", __LINE__,__WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
//we don't take ownership of the transformation being returned but
//will release [sourceDatum] and [targetDatum];
@@ -239,7 +239,7 @@
default: //invalid state; why's that?
_ASSERT(false);
- throw new MgException(L"CCoordinateSystemGeodeticTransformDef.GetParameters", __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
}
}
@@ -311,7 +311,7 @@
}
if (NULL == transformDefParams)
- throw new MgException(L"CCoordinateSystemGeodeticTransformDef.SetParameters", __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
//copy the values from the parameter we've been passed into our own [parameters] section
transformDefParams->CopyTo(&this->transformDefinition->parameters);
@@ -377,7 +377,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
// In case an exception gets thrown.
@@ -417,7 +417,7 @@
// Nope! It's not valid, but not valid in such a way that would cause
// an exception to be thrown. transformationDefinition cannot be
// NULL at this point.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformDef.SerializeFrom", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
@@ -446,7 +446,7 @@
assert(NULL != pStream);
if (!pStream)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformDef.SerializeTo", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//save the version
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGeodeticTransformation.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -46,7 +46,7 @@
: m_pDtcprm(NULL), m_pDtSource(NULL), m_pDtTarget(NULL)
{
if (NULL == pCatalog || NULL == transformationDef)
- throw new MgException(L"CCoordinateSystemGeodeticTransformation.ctor", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
//Uninitialize(); //not needed - this does release the resourced held by this instance; we haven't set anything yet
@@ -90,7 +90,7 @@
MgCoordinateSystemDatum *pSourceTmp=GetWGS84IfNull(pSource);
if (!pSourceTmp)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException");
}
CCoordinateSystemDatum* pDtSourceImp=dynamic_cast<CCoordinateSystemDatum*>(pSourceTmp);
assert(pDtSourceImp);
@@ -101,7 +101,7 @@
{
SAFE_RELEASE(pSourceTmp);
}
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException");
}
//Set up our target datum
@@ -113,7 +113,7 @@
{
SAFE_RELEASE(pSourceTmp);
}
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException");
}
CCoordinateSystemDatum* pDtTargetImp=dynamic_cast<CCoordinateSystemDatum*>(pTargetTmp);
assert(pDtTargetImp);
@@ -129,7 +129,7 @@
{
SAFE_RELEASE(pTargetTmp);
}
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException");
}
//Set up our datum conversion struct
@@ -139,7 +139,7 @@
assert(pDtcprm);
if (!pDtcprm)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemGeodeticTransformationSetupException", NULL);
+ throw new MgException(L"MgCoordinateSystemGeodeticTransformationSetupException");
}
Uninitialize();
@@ -171,7 +171,7 @@
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetSource", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return SAFE_ADDREF(m_pDtSource);
@@ -186,7 +186,7 @@
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetTarget", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return SAFE_ADDREF(m_pDtTarget);
@@ -221,12 +221,12 @@
if (1==nResult)
{
// Partial failure - Outside the useful range.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionWarningException");
}
else if (-1==nResult)
{
// Total failure - Outside the mathematical domain.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionExtentException");
}
pLonLat->SetX(dLongitude);
pLonLat->SetY(dLatitude);
@@ -261,12 +261,12 @@
if (1==nResult)
{
// Partial failure - Outside the useful range.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionWarningException");
}
else if (-1==nResult)
{
// Total failure - Outside the mathematical domain.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionExtentException");
}
pCoord=new MgCoordinateXY(dLongitude, dLatitude);
@@ -301,12 +301,12 @@
if (1==nResult)
{
// Partial failure - Outside the useful range.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionWarningException");
}
else if (-1==nResult)
{
// Total failure - Outside the mathematical domain.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.Shift", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionExtentException");
}
pCoord=new MgCoordinateXYZ(dLongitude, dLatitude, dZ);
@@ -354,7 +354,7 @@
CCoordinateSystemGeodeticTransformDef* transformDefImpl = dynamic_cast<CCoordinateSystemGeodeticTransformDef*>(transformationDef);
if (NULL == transformDefImpl)
- throw new MgException(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
cs_GeodeticTransform_ csMapTransformDef;
transformDefImpl->CopyTo(csMapTransformDef);
@@ -363,7 +363,7 @@
datumTransform = CSdtcsu2(&csMapTransformDef, createInversed ? cs_DTCDIR_INV : cs_DTCDIR_FWD, cs_DTCFLG_BLK_W);
if (NULL == datumTransform)
- throw new MgException(L"CCoordinateSystemGeodeticTransformation.SetupFromTransformationDef", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
Ptr<MgCoordinateSystemDatumDictionary> datumDictionary = this->m_pCatalog->GetDatumDictionary();
Ptr<MgCoordinateSystemDatum> srcDatum = datumDictionary->GetDatum(transformationDef->GetSourceDatum());
@@ -470,7 +470,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetOffsetX", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult=def.delta_X;
@@ -485,7 +485,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetOffsetY", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult=def.delta_Y;
@@ -500,7 +500,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetOffsetZ", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult=def.delta_Z;
@@ -521,26 +521,26 @@
{
if (!m_pDtSource || !m_pDtTarget)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//if not WGS84 for the target system, bye bye!
if (m_pDtTarget->GetDtCode()!=kpWGS84Datum)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
CCoordinateSystemDatum* pDatumImp=dynamic_cast<CCoordinateSystemDatum*>(m_pDtSource);
assert(pDatumImp);
if (!pDatumImp)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//Make sure this object isn't read-only
if (m_pDtSource->IsProtected())
{
//can't change a read-only object
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumProtectedException");
}
if (!IsLegalDatumOffset(x) ||
@@ -548,7 +548,7 @@
!IsLegalDatumOffset(z))
{
//Caller gave us an illegal value.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetOffset", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
pDatumImp->m_DtDef.delta_X = pDatumImp->m_datum.delta_X = x;
@@ -577,7 +577,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationX", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult = def.rot_X;
@@ -593,7 +593,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationY", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult = def.rot_Y;
@@ -609,7 +609,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformRotationZ", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult = def.rot_Z;
@@ -625,7 +625,7 @@
cs_Dtdef_ def;
if (!GetDefinitionForGeodeticTransformationParameter(def))
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.GetBursaWolfeTransformBwScale", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
dResult = def.bwscale;
@@ -648,26 +648,26 @@
{
if (!m_pDtSource || !m_pDtTarget)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"NullArgument");
}
//if not WGS84 for the target system, bye bye!
if (m_pDtTarget->GetDtCode()!=kpWGS84Datum)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
CCoordinateSystemDatum* pDatumImp=dynamic_cast<CCoordinateSystemDatum*>(m_pDtSource);
assert(pDatumImp);
if (!pDatumImp)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//Make sure this object isn't read-only
if (m_pDtSource->IsProtected())
{
//can't change a read-only object
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumProtectedException");
}
if (!IsLegalDatumRotation(dRotationX) ||
@@ -676,7 +676,7 @@
!::IsLegalBwScale(dBwScale))
{
//Caller gave us an illegal value.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetBursaWolfeTransform", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
pDatumImp->m_DtDef.rot_X = pDatumImp->m_datum.rot_X = dRotationX;
@@ -726,32 +726,32 @@
{
if (!m_pDtSource || !m_pDtTarget)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//if not WGS84 for the target system, bye bye!
if (m_pDtTarget->GetDtCode()!=kpWGS84Datum)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
CCoordinateSystemDatum* pDatumImp=dynamic_cast<CCoordinateSystemDatum*>(m_pDtSource);
assert(pDatumImp);
if (!pDatumImp)
{
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//Make sure this object isn't read-only
if (m_pDtSource->IsProtected())
{
//can't change a read-only object
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDatumProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDatumProtectedException");
}
if (!IsLegalGeodeticTransformationMethod(nGeodeticTransformationMethod))
{
//Not one of the known datum conversion techniques.
- throw new MgException(L"MgCoordinateSystemGeodeticTransformation.SetGeodeticTransformationMethod", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
pDatumImp->m_DtDef.to84_via = pDatumImp->m_datum.to84_via = nGeodeticTransformationMethod;
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGrids.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGrids.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysGrids.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -182,8 +182,7 @@
codeOk = GetUnitInfo(unitCode,&lclUnitType,NULL);
if (!codeOk || unitType != lclUnitType)
{
- throw new MgException(L"MgCoordinateSystemGridSpecification.SetUnits",
- __LINE__, __WFILE__, NULL, L"InvalidCoordinateSystemUnits", NULL);
+ throw new MgException(L"InvalidCoordinateSystemUnits");
}
m_UnitCode = unitCode;
@@ -352,7 +351,7 @@
GetUnitInfo(trgUnitCode,&trgUnitType,NULL);
if (trgUnitType != m_UnitType)
{
- throw new MgException(L"MgCoordinateSystemGridSpecification.ConvertUnitsOfValue", __LINE__, __WFILE__, NULL, L"InvalidCoordinateSystemUnits", NULL);
+ throw new MgException(L"InvalidCoordinateSystemUnits");
}
// Calculate the appropriate units conversion factor. Since the unit types
@@ -952,14 +951,14 @@
void CCoordinateSystemGridLineCollection::SetItem (INT32 index,MgCoordinateSystemGridLine* value)
{
if (GetAvailableMemory() < m_MemoryThreshold)
- throw new MgException(L"CCoordinateSystemGridLineCollection.SetItem", __LINE__, __WFILE__, NULL, L"GridDensity", NULL);
+ throw new MgException(L"GridDensity");
m_GridLineCollection->SetItem (index,value);
}
void CCoordinateSystemGridLineCollection::Add (MgCoordinateSystemGridLine* value)
{
if (GetAvailableMemory() < m_MemoryThreshold)
- throw new MgException(L"CCoordinateSystemGridLineCollection.Add", __LINE__, __WFILE__, NULL, L"GridDensity", NULL);
+ throw new MgException(L"GridDensity");
// The MgDIsposableCollection object does the "SAFE_ADDREF" operation.
m_GridLineCollection->Add (value);
@@ -1024,14 +1023,14 @@
void CCoordinateSystemGridRegionCollection::SetItem (INT32 index, MgCoordinateSystemGridRegion* value)
{
if (GetAvailableMemory() < m_MemoryThreshold)
- throw new MgException(L"CCoordinateSystemGridRegionCollection.SetItem", __LINE__, __WFILE__, NULL, L"GridDensity", NULL);
+ throw new MgException(L"GridDensity");
m_GridRegionCollection->SetItem (index,value);
}
void CCoordinateSystemGridRegionCollection::Add (MgCoordinateSystemGridRegion* value)
{
if (GetAvailableMemory() < m_MemoryThreshold)
- throw new MgException(L"CCoordinateSystemGridRegionCollection.Add", __LINE__, __WFILE__, NULL, L"GridDensity", NULL);
+ throw new MgException(L"GridDensity");
m_GridRegionCollection->Add (value);
}
@@ -1097,14 +1096,14 @@
void CCoordinateSystemGridTickCollection::SetItem (INT32 index, MgCoordinateSystemGridTick* value)
{
if (GetAvailableMemory() < m_MemoryThreshold)
- throw new MgException(L"CCoordinateSystemGridTickCollection.SetItem", __LINE__, __WFILE__, NULL, L"GridDensity", NULL);
+ throw new MgException(L"GridDensity");
m_GridTickCollection->SetItem (index,value);
}
void CCoordinateSystemGridTickCollection::Add (MgCoordinateSystemGridTick* value)
{
if (GetAvailableMemory() < m_MemoryThreshold)
- throw new MgException(L"CCoordinateSystemGridTickCollection.Add", __LINE__, __WFILE__, NULL, L"GridDensity", NULL);
+ throw new MgException(L"GridDensity");
m_GridTickCollection->Add (value);
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMacro.h
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMacro.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMacro.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -26,17 +26,17 @@
#ifdef CS_MAP_DEF_VARIABLE
#define VERIFY_INITIALIZED(x) if (NULL == CS_MAP_DEF_VARIABLE) \
- throw new MgException(x, __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL)
+ throw new MgException(L"InvalidOperation")
#else
#define VERIFY_INITIALIZED(x)
#endif
#define VERIFY_NOT_PROTECTED(x) if (this->IsProtected()) \
- throw new MgException(x, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
#define ENSURE_NOT_NULL(param,method) \
if (NULL == param) \
- throw new MgException(method, __LINE__, __WFILE__, NULL, L"NullArgument", NULL)
+ throw new MgException(L"NullArgument")
#define DEFINE_GET_STRING(x,y) STRING x::Get##y()
#define DEFINE_SET_STRING(x,y) void x::Set##y(CREFSTRING propertyValue)
@@ -51,7 +51,7 @@
{ \
VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName)); \
if (this->IsProtected()) \
- throw new MgException(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+ throw new MgException(L"MgCoordinateSystemProtectedException"); \
\
MentorSetString(propertyValue, charBuffer /* target buffer */, sizeof(charBuffer)); \
}
@@ -72,7 +72,7 @@
{ \
VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName)); \
if (this->IsProtected()) \
- throw new MgException(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+ throw new MgException(L"MgCoordinateSystemProtectedException"); \
\
target = propertyValue;\
}
@@ -82,7 +82,7 @@
{ \
VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName)); \
if (index < 0 || index > maxIdx) \
- throw new MgException(MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName), __LINE__, __WFILE__, NULL, L"ArgumentOutOfRange", NULL); \
+ throw new MgException(L"ArgumentOutOfRange"); \
\
return target[index]; \
} \
@@ -90,10 +90,10 @@
{ \
VERIFY_INITIALIZED(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName)); \
if (this->IsProtected()) \
- throw new MgException(MAKE_QUALIFIED_MEMBER_STRING(className,Set##propertyName), __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL); \
+ throw new MgException(L"MgCoordinateSystemProtectedException"); \
\
if (index < 0 || index > maxIdx) \
- throw new MgException(MAKE_QUALIFIED_MEMBER_STRING(className,Get##propertyName), __LINE__, __WFILE__, NULL, L"ArgumentOutOfRange", NULL); \
+ throw new MgException(L"ArgumentOutOfRange"); \
\
target[index] = propertyValue;\
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMeasure.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMeasure.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMeasure.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -37,7 +37,7 @@
{
if(NULL == pCoordSys)
{
- throw new MgException(L"MgCoordinateSystemMeasure.MgCoordinateSystemMeasure", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
m_pCoordSys = SAFE_ADDREF(pCoordSys);
@@ -96,7 +96,7 @@
double distance = 0.0;
if((NULL == coord1) || (NULL == coord2))
{
- throw new MgException(L"MgCoordinateSystemMeasure.GetDistance", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
distance = GetDistance(coord1->GetX(), coord1->GetY(), coord2->GetX(), coord2->GetY());
@@ -140,7 +140,7 @@
if((NULL == coord1) || (NULL == coord2))
{
- throw new MgException(L"MgCoordinateSystemMeasure.GetAzimuth", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
azimuth = GetAzimuth(coord1->GetX(), coord1->GetY(), coord2->GetX(), coord2->GetY());
@@ -189,7 +189,7 @@
{
if(NULL == coord)
{
- throw new MgException(L"MgCoordinateSystemMeasure.GetCoordinate", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
return GetCoordinate(coord->GetX(), coord->GetY(), azimuth, distance);
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMgrs.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMgrs.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysMgrs.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -130,7 +130,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.Init", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
else
{
@@ -158,7 +158,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.InitFromEllipsoid", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
else
{
@@ -186,7 +186,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.InitFromDatum", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
else
{
@@ -363,8 +363,7 @@
if (m_GridBoundary == 0)
{
// Proceeding without a grid boundary will cause a crash.
- throw new MgException(L"MgCoordinateSystemMgrs.GetGridLines",
- __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
theGridLineCollection = new CCoordinateSystemGridLineCollection (m_GridLineMemoryThreshold);
@@ -419,8 +418,7 @@
if (m_GridBoundary == 0)
{
// Proceeding without a grid boundary will cause a crash.
- throw new MgException(L"MgCoordinateSystemMgrs.GetGridRegions",
- __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
theGridRegionCollection = new CCoordinateSystemGridRegionCollection (m_GridRegionMemoryThreshold);
@@ -449,8 +447,7 @@
if (m_GridBoundary == 0)
{
// Proceeding without a grid boundary will cause a crash.
- throw new MgException(L"MgCoordinateSystemMgrs.GetGridRegions",
- __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
theGridTickCollection = new CCoordinateSystemGridTickCollection (m_GridTickMemoryThreshold);
@@ -669,7 +666,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
else
{
@@ -698,7 +695,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+ throw new MgException(L"MgCoordinateSystemNoConversionDone");
}
else
{
@@ -717,7 +714,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertFromLonLat", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
else
{
@@ -743,7 +740,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
else
{
@@ -777,7 +774,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
else
{
@@ -791,7 +788,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
else
{
@@ -818,7 +815,7 @@
{
if (m_bExceptionsOn)
{
- throw new MgException(L"MgCoordinateSystemMgrs.ConvertToLonLat", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+ throw new MgException(L"MgCoordinateSystemNoConversionDone");
}
else
{
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysProjectionInformation.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysProjectionInformation.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysProjectionInformation.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -150,7 +150,7 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterCount", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
// for each possible parameter.
int parmIdx = 0;
@@ -174,13 +174,13 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.IsUsingParameter", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterCount", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
int nResult = CS_prjprm(NULL, nProjectionCode, ulIndex-1);
@@ -245,12 +245,12 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Get information about the parameter
@@ -263,12 +263,12 @@
break;
case 0:
//The projection does not use this parameter.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
break;
case -1:
default:
//Not a valid projection.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMin", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -283,12 +283,12 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Get information about the parameter
@@ -301,12 +301,12 @@
break;
case 0:
//The projection does not use this parameter.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
break;
case -1:
default:
//Not a valid projection.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParameterMax", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -328,13 +328,13 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Get information about the parameter
@@ -347,12 +347,12 @@
break;
case 0:
//The projection does not use this parameter.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
break;
case -1:
default:
//Not a valid projection.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamDefault", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -377,13 +377,13 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Get information about the parameter
@@ -396,12 +396,12 @@
break;
case 0:
//The projection does not use this parameter.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
break;
case -1:
default:
//Not a valid projection.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamLogicalType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -425,13 +425,13 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Get information about the parameter
@@ -444,12 +444,12 @@
break;
case 0:
//The projection does not use this parameter.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
break;
case -1:
default:
//Not a valid projection.
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamFormatType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -475,13 +475,13 @@
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
assert((ulIndex>=1) && (ulIndex<=knCsNumParams));
if ((ulIndex < 1) || (ulIndex > knCsNumParams))
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//MENTOR_MAINTENANCE
@@ -497,12 +497,12 @@
}
if (mp->prj_code == cs_PRJCOD_END)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
nIndex = mp->prm_types[ulIndex-1];
if (nIndex <= 0)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetParamType", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemMismatchException", NULL);
+ throw new MgException(L"MgCoordinateSystemMismatchException");
}
paramType = static_cast<INT32>(nIndex);
@@ -535,7 +535,7 @@
{
if (MgCoordinateSystemProjectionCode::Unknown == nProjectionCode)
{
- throw new MgException(L"MgCoordinateSystemProjectionInformation.GetTagString", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
wchar_t* pszTag=Convert_Ascii_To_Wide(StringFromProjection(nProjectionCode));
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysTransform.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysTransform.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysTransform.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -103,7 +103,7 @@
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.IsValidPoint", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
//Test the point
@@ -397,7 +397,7 @@
if(NULL == coordinate)
{
- throw new MgException(L"MgCoordinateSystemTransform.TransformCoordinate", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
m_nTransformStatus = TransformOk; // until we know different
@@ -499,7 +499,7 @@
else
{
// What dimension is this?
- throw new MgException(L"MgCoordinateSystemTransform.TransformCoordinate", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (status != TransformOk)
{
@@ -525,7 +525,7 @@
if(NULL == coordinate)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Need to determine type of coordinate to transform
if(coordinate->GetDimension() == MgCoordinateDimension::XY)
@@ -551,7 +551,7 @@
else
{
// What dimension is this?
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
return pCoordinate;
@@ -610,7 +610,7 @@
if(NULL == envelope)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Extract the two defining corners of this envelope.
@@ -745,7 +745,7 @@
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.GetSource", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
return SAFE_ADDREF(m_pCsSource.p);
@@ -760,7 +760,7 @@
//Make sure we're initialized
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.GetTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
return SAFE_ADDREF(m_pCsTarget.p);
@@ -781,7 +781,7 @@
{
if (NULL == pSource || NULL == pTarget)
{
- throw new MgException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
bool bValid;
@@ -790,14 +790,14 @@
bValid = pSource->IsValid();
if (!bValid)
{
- throw new MgException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Make sure the destination coordinate system is valid
bValid = pTarget->IsValid();
if (!bValid)
{
- throw new MgException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Build Mentor structs out of the source and destination
@@ -805,12 +805,12 @@
bool bResult = BuildCsprmFromInterface(pSource, srcCsprm);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
bResult = BuildCsprmFromInterface(pTarget, dstCsprm);
if (!bResult)
{
- throw new MgException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
//Attempt to set up a datum conversion.
@@ -824,7 +824,7 @@
//This can easily happen if, for example, it's a NADCON
//datum shift and Mentor couldn't find the NADCON
//data files at run time.
- throw new MgException(L"MgCoordinateSystemTransform.SetSourceAndTarget", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemGeodeticTransformationSetupException", NULL);
+ throw new MgException(L"MgCoordinateSystemGeodeticTransformationSetupException");
}
//Okay, we're all set! Uninitialize ourselves, and
@@ -867,17 +867,17 @@
MgCoordinateSystemGeodeticTransformDef* CCoordinateSystemTransform::GetGeodeticTransformation (INT32 index)
{
if (index < 0 || index >= this->GetGeodeticTransformationCount())
- throw new MgException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"ArgumentOutOfRange", NULL);
+ throw new MgException(L"ArgumentOutOfRange");
// indexparameter is valid, get a pointer to the appropriate
// CS-MAP transformation object.
cs_GxXform_ *xfrmPtr = m_pDtcprm->xforms [index];
if (NULL == xfrmPtr)
- throw new MgException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
cs_GeodeticTransform_* xfrmDefPtr = &xfrmPtr->gxDef;
if (NULL == xfrmDefPtr)
- throw new MgException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
// Extract the name of the transformation.
Ptr<MgCoordinateSystemGeodeticTransformDef> catalogTransformationDef;
@@ -905,7 +905,7 @@
//in this case, CSMAP returns a [xfrmDefPtr] but the actual (explicit) transformation definition
//doesn't exist in the dictionaries
if (NULL == catalogTransformationDef)
- throw new MgException(L"GetGeodeticTransformation.GetGeodeticTransformation",__LINE__,__WFILE__, NULL, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed");
MG_CATCH(L"GetGeodeticTransformation.GetGeodeticTransformation")
@@ -1012,7 +1012,7 @@
assert(NULL != y);
if (NULL == x || NULL == y)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1062,7 +1062,7 @@
assert(NULL != y);
if (NULL == x || NULL == y)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1074,7 +1074,7 @@
assert(IsInitialized());
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
dCoords [2] = 0.0;
@@ -1136,7 +1136,7 @@
assert(NULL != y);
if (NULL == x || NULL == y)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1187,7 +1187,7 @@
assert(NULL != m);
if (NULL == x || NULL == y || NULL == m)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1199,7 +1199,7 @@
assert(IsInitialized());
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
dCoords [2] = 0.0;
@@ -1265,7 +1265,7 @@
assert(NULL != z);
if (NULL == x || NULL == y || NULL == z)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1316,7 +1316,7 @@
assert(NULL != z);
if (NULL == x || NULL == y || NULL == z)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1328,7 +1328,7 @@
assert(IsInitialized());
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
m_nTransformStatus = TransformOk;
@@ -1395,7 +1395,7 @@
assert(NULL != m);
if (NULL == x || NULL == y || NULL == z || NULL == m)
{
- throw new MgException(L"MgCoordinateSystemTransform.TransformM", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1447,7 +1447,7 @@
assert(NULL != m);
if (NULL == x || NULL == y || NULL == z || NULL == m)
{
- throw new MgException(L"MgCoordinateSystemTransform.TransformM", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
// Optimization
@@ -1459,7 +1459,7 @@
assert(IsInitialized());
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
m_nTransformStatus = TransformOk;
@@ -1526,17 +1526,17 @@
assert(NULL != xy);
if (NULL == xy)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
assert(pointCount > 0);
if (0 >= pointCount)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
assert(IsInitialized());
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
// Optimization
@@ -1579,7 +1579,7 @@
}
if (TransformTotalFailure <= status)
{
- throw new MgException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+ throw new MgException(L"MgCoordinateSystemNoConversionDone");
}
return;
}
@@ -1594,17 +1594,17 @@
assert(NULL != xyz);
if (NULL == xyz)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
assert(pointCount > 0);
if (0 >= pointCount)
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
assert(IsInitialized());
if (!IsInitialized())
{
- throw new MgException(L"MgCoordinateSystemTransform.Transform", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
// Optimization
@@ -1647,7 +1647,7 @@
}
if (TransformTotalFailure <= status)
{
- throw new MgException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+ throw new MgException(L"MgCoordinateSystemNoConversionDone");
}
return;
}
@@ -1892,8 +1892,7 @@
else
{
// Invalid argument value.
- throw new MgException(L"MgCoordinateSystemTransform.PositionOfValue",
- __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
if (minValue > maxValue)
@@ -2232,7 +2231,7 @@
if (status == TransformTotalFailure)
{
m_nTransformStatus = TransformTotalFailure;
- throw new MgException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoConversionDone", NULL);
+ throw new MgException(L"MgCoordinateSystemNoConversionDone");
}
else if (status == TransformDatumShiftWarning)
{
@@ -2242,7 +2241,7 @@
}
if (!m_bIgnoreDatumShiftWarning)
{
- throw new MgException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionWarningException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionWarningException");
}
}
else if (status != TransformOk)
@@ -2253,7 +2252,7 @@
}
if(!m_bIgnoreOutsideDomainWarning)
{
- throw new MgException(L"MgCoordinateSystemTransform.InterpretStatus", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemConversionExtentException", NULL);
+ throw new MgException(L"MgCoordinateSystemConversionExtentException");
}
}
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUnitInformation.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUnitInformation.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUnitInformation.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -141,16 +141,12 @@
INT32 unitType;
if (!GetUnitInfo(unit, &unitType, &dScale))
{
- MgStringCollection arguments;
- arguments.Add(L""); // dummy argument
- throw new MgException(L"MgCoordinateSystemUnitInformation.GetScale", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemUnknownUnit", NULL);
+ throw new MgException(L"MgCoordinateSystemUnknownUnit");
}
if (desiredUnitType != unitType)
{
- MgStringCollection arguments;
- arguments.Add(L""); // dummy argument
- throw new MgException(L"MgCoordinateSystemUnitInformation.GetScale", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotLinearUnit", NULL);
+ throw new MgException(L"MgCoordinateSystemNotLinearUnit");
}
return dScale;
@@ -251,7 +247,7 @@
if (NULL == kpTag)
{
//Unknown unit type.
- throw new MgException(L"MgCoordinateSystemUnitInformation.GetAbbreviation", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Look it up in Mentor's table
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUtil.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUtil.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysUtil.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -73,31 +73,27 @@
case kFileIsValid:
break;
case kFileInvalidEmptyString:
- throw new MgException(wszMethodName, __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
case kFileInvalidNotADir:
case kFileInvalidIsADir:
{
- MgStringCollection arguments;
- arguments.Add(sPathName);
- throw new MgException(wszMethodName, __LINE__, __WFILE__, &arguments, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument: " + sPathName);
}
break;
case kFileInvalidPath:
case kFileInvalidDoesNotExist:
{
- MgStringCollection arguments;
- arguments.Add(sPathName);
- throw new MgException(wszMethodName, __LINE__, __WFILE__, &arguments, L"FileNotFound", NULL);
+ throw new MgException(L"FileNotFound: " + sPathName);
}
break;
case kFileInvalidCantRead:
case kFileInvalidCantWrite:
- throw new MgException(wszMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemCatalogFileLockedException", NULL);
+ throw new MgException(L"MgCoordinateSystemCatalogFileLockedException");
break;
default:
assert(0);
- throw new MgException(wszMethodName, __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"");
break;
}
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/CoordSysWktFailureCache.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/CoordSysWktFailureCache.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/CoordSysWktFailureCache.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -93,8 +93,7 @@
{
if (key.empty() || NULL == mgException)
{
- throw new MgException(L"CCoordinateSystemWktFailureCache.Set",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgLock lock(m_mutex);
@@ -123,8 +122,7 @@
if (key.empty())
{
- throw new MgException(L"CCoordinateSystemWktFailureCache.Has",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgLock lock(m_mutex);
@@ -153,8 +151,7 @@
{
if (key.empty())
{
- throw new MgException(L"CCoordinateSystemWktFailureCache.Get",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgLock lock(m_mutex);
Modified: sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -58,7 +58,7 @@
bWriting = true;
break;
default:
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
}
@@ -74,26 +74,22 @@
switch (reason)
{
case kFileInvalidEmptyString:
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
break;
case kFileInvalidPath:
case kFileInvalidDoesNotExist:
case kFileInvalidIsADir:
{
- MgStringCollection arguments;
- arguments.Add(kpPath);
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, &arguments, L"FileNotFound", NULL);
+ throw new MgException(STRING(L"FileNotFound: ") + kpPath);
}
break;
case kFileInvalidCantWrite:
{
- MgStringCollection arguments;
- arguments.Add(kpPath);
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemDictionaryReadOnlyException", NULL);
- }
+ throw new MgException(STRING(L"MgCoordinateSystemDictionaryReadOnlyException: ") + kpPath);
+ }
break;
default:
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"");
break;
}
//return;
@@ -104,7 +100,7 @@
GetFileModes(nOpenMode, szMode);
if (NULL==(pFile=OpenDictionaryFile(kpPath, szMode, lMagic, ValidMagic)))
{
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryOpenFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryOpenFailedException");
}
//If the Mentor version is anything other than current, we're not allowed
@@ -114,7 +110,7 @@
//Sorry, old version. Write access not allowed.
CS_fclose(pFile);
pFile=NULL;
- throw new MgException(L"MentorDictionary.Open", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryNoWriteToOldException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryNoWriteToOldException");
}
return pFile;
@@ -152,7 +148,7 @@
if (sDirectory.empty())
{
//Directory hasn't been specified yet.
- throw new MgException(kpMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNotReadyException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotReadyException");
}
STRING sPath = sDirectory + sFileName;
@@ -172,7 +168,7 @@
//Try to open the dictionary file
if (!GetMagicFromDictionaryFile(sPath.c_str(), lMagic, ValidMagic))
{
- throw new MgException(kpMethodName, __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryOpenFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryOpenFailedException");
}
}//if dictionary is specified
Modified: sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.h
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/MentorDictionary.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -63,7 +63,7 @@
return false;
//i.e. nResult < 0
- throw new MgException(L"MentorDictionary.GetNextEntry", __LINE__, __WFILE__, NULL, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
}
//iterates through all entries return a vector of definitions in the same order as they've been returned by CsMap
@@ -122,7 +122,7 @@
allDefs.reset(MentorDictionary::ReadDictionaryEntries<T>(pFile, CS_Trd));
if (NULL == allDefs.get())
- throw new MgException(L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
MG_CATCH(L"MentorDictionary.ReadDictionaryEntries")
@@ -130,7 +130,7 @@
pFile = NULL;
if (!fileClosed && NULL == mgException)
- throw new MgException(L"MentorDictionary.ReadDictionaryEntries", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDictionaryCloseFailedException", NULL);
+ throw new MgException(L"MgCoordinateSystemDictionaryCloseFailedException");
MG_THROW()
@@ -202,10 +202,10 @@
/*IN/OUT, required*/ std::map<STRING, Ptr<MgDisposable> >& definitions)
{
if (NULL == targetDictionary || NULL == GetCode)
- throw new MgException(L"MentorDictionary.ReadAllDefinitions", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
if (0 != definitions.size())
- throw new MgException(L"MentorDictionary.ReadAllDefinitions", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
const UINT32 entryCount = targetDictionary->GetSize();;
@@ -232,7 +232,7 @@
/*IN, optional*/const std::vector<MgCoordinateSystemFilter*>* const filters)
{
if (NULL == toBeFiltered)
- throw new MgException(L"MentorDictionary.FilterDefinitions", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
if (NULL == filters)
return SAFE_ADDREF(toBeFiltered); //see coment - the caller does always have to release the collection being returned
@@ -247,7 +247,7 @@
Ptr<MgDisposable> disposableItem = toBeFiltered->GetItem((INT32)j);
T* mgCsItem = dynamic_cast<T*>(disposableItem.p);
if (NULL == mgCsItem)
- throw new MgException(L"MentorDictionary.FilterDefinitions", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
//exclude the [mgCsItem], if it's not accepted by the filter we got
if (filters->at(j)->IsFilteredOut(mgCsItem))
@@ -272,15 +272,15 @@
{
//'true' input parameter check
if (NULL == primaryDictionary)
- throw new MgException(L"MentorDictionary.ReadAllDefinitionsCascaded", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
//method pointer checks
if (NULL == GetMgItem || NULL == CS_Trd)
- throw new MgException(L"MentorDictionary.ReadAllDefinitionsCascaded", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
auto_ptr<vector<U> > allDefs(MentorDictionary::ReadDictionaryEntries<U>(primaryDictionary, CS_Trd));
if (NULL == allDefs.get()) //[ReadDictionaryEntries] will return NULL, if the dictionary entries couldn't be read
- throw new MgException(L"MgCoordinateSystemDictionary.ReadAllCoordinateSystems", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
const bool doPostProcess = (NULL != PostProcess);
Ptr<MgDisposableCollection> filteredDefinitions = new MgDisposableCollection();
@@ -326,13 +326,13 @@
assert(NULL != kpDef);
if (NULL == kpDef)
{
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
//Make sure the def they've given us is valid
if (NULL != isValid && !CALL_MEMBER_FN(kpDef, isValid)())
{
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Build a definition from the interface
@@ -340,7 +340,7 @@
bool bResult = BuildDefFromInterface(kpDef, def);
if (!bResult)
{
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
const char* keyName = key(def);
@@ -374,15 +374,13 @@
if (bActuallyExists && !bAlreadyExists)
{
//It already exists, but it's not supposed to.
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemDuplicateException", NULL);
+ throw new MgException(L"MgCoordinateSystemDuplicateException");
}
else if (!bActuallyExists && bAlreadyExists)
{
//It doesn't exist, but it's supposed to.
STRING message = MgUtil::MultiByteToWideChar(string(keyName));
- MgStringCollection arguments;
- arguments.Add(message);
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, &arguments, L"CoordinateSystemLoadFailed", NULL);
+ throw new MgException(L"CoordinateSystemLoadFailed: " + message);
}
if (verifyNotProtected)
@@ -390,7 +388,7 @@
//If it already exists, make sure it's not protected.
if ((bAlreadyExists) && (IsReallyProtected(sProtect)))
{
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
}
@@ -406,7 +404,7 @@
{
case -1:
//Some sort of Mentor error occurred.
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
return;
case 0:
//The new object was added to the dictionary.
@@ -465,7 +463,7 @@
default:
//This should never happen.
assert(0);
- throw new MgException(L"MentorDictionary.UpdateDef", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"");
} //for each possible result of the update
}
@@ -505,13 +503,11 @@
if (iter == pmapSystemNameDescription->end())
{
STRING message = MgUtil::MultiByteToWideChar(string(pName));
- MgStringCollection arguments;
- arguments.Add(message);
//Nope, it's not in our summary, so it ain't
//there. We can return failure without the
//overhead of searching the disk file.
delete [] pName;
- throw new MgException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException: " + message);
}
}
//Get def from disk file. We need to do this even if
@@ -523,16 +519,14 @@
if (NULL == pDef)
{
STRING message = MgUtil::MultiByteToWideChar(string(pName));
- MgStringCollection arguments;
- arguments.Add(message);
- throw new MgException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, &arguments, L"MgCoordinateSystemNotFoundException", NULL);
+ throw new MgException(L"MgCoordinateSystemNotFoundException: " + message);
}
//Make sure it's not protected
if (IsReallyProtected(pDef->protect))
{
CS_free(pDef);
- throw new MgException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemProtectedException", NULL);
+ throw new MgException(L"MgCoordinateSystemProtectedException");
}
//Go ahead and attempt to delete it
@@ -550,7 +544,7 @@
else
{
//Failed.
- throw new MgException(L"MentorDictionary.RemoveDef", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemInternalException", NULL);
+ throw new MgException(L"MgCoordinateSystemInternalException");
}
}
Modified: sandbox/adsk/vik/Common/CoordinateSystem/MentorUtil.cpp
===================================================================
--- sandbox/adsk/vik/Common/CoordinateSystem/MentorUtil.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/CoordinateSystem/MentorUtil.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1407,14 +1407,11 @@
const wchar_t* context)
{
if (NULL == MagicNumberCallback || NULL == FileNameTarget)
- throw new MgException(L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
if (sFileName.empty() || dictionaryPath.empty())
{
- MgStringCollection arguments;
- arguments.Add(sFileName);
-
- throw new MgException(L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, NULL, L"ArgumentOutOfRange", NULL);
+ throw new MgException(L"ArgumentOutOfRange: " + sFileName);
}
char* szCs = NULL;
@@ -1426,9 +1423,7 @@
bool bResult = IsValidDictionaryName(sFileName);
if (!bResult)
{
- MgStringCollection arguments;
- arguments.Add(sFileName);
- throw new MgException(/*context */ L"MentorUtil.SetDictionaryFileName", __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + sFileName);
}
STRING fileNameSet;
@@ -1654,13 +1649,13 @@
if (NULL==pDest)
{
- throw new MgException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
if (!IsLegalString(sSrc.c_str(), nMaxSize))
{
//Can't set string, caller gave us an illegal value
- throw new MgException(L"MentorSetString", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
//Convert to a C++ string, for Mentor's sake
Modified: sandbox/adsk/vik/Common/Foundation/Data/NamedCollection.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Data/NamedCollection.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Data/NamedCollection.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -112,7 +112,7 @@
{
MgNamedSerializable* item = FindItem(name);
if (!item)
- throw new MgException(L"GetItem", __LINE__, __WFILE__, NULL, L"ObjectNotFound", NULL); // EXC::Create(Exception::NLSGetMessage(NLSID(38_ITEMNOTFOUND),name));
+ throw new MgException(L"ObjectNotFound");
return item;
}
@@ -379,12 +379,7 @@
{
if (name.length() == 0)
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(MgResources::BlankArgument);
-
- throw new MgException(L"MgNamedCollection.IndexOf",
- __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL); // EXC::Create(Exception::NLSGetMessage(NLSID(2_BADPARAMETER)));
+ throw new MgException(L"MgStringEmpty");
}
INT32 size = GetCount();
@@ -493,7 +488,7 @@
foundItem2 = GetItem(index);
if ((foundItem1 != NULL) && (foundItem1.p != foundItem2.p))
- throw new MgException(L"CheckDuplicate", __LINE__, __WFILE__, NULL, L"DuplicateObject", NULL);
+ throw new MgException(L"DuplicateObject");
}
}
Modified: sandbox/adsk/vik/Common/Foundation/Data/NullableProperty.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Data/NullableProperty.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Data/NullableProperty.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -65,13 +65,9 @@
void MgNullableProperty::CheckNull()
{
- if (this->IsNull())
+ if (IsNull())
{
- MgStringCollection arguments;
- arguments.Add(this->GetName());
-
- throw new MgException(L"MgNullableProperty.CheckNull",
- __LINE__, __WFILE__, &arguments, L"NullPropertyValue", NULL);
+ throw new MgException(L"NullPropertyValue: " + GetName());
}
}
Modified: sandbox/adsk/vik/Common/Foundation/Data/Property.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Data/Property.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Data/Property.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -66,12 +66,7 @@
{
if (name.empty())
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(MgResources::BlankArgument);
-
- throw new MgException(L"MgProperty.SetName",
- __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
+ throw new MgException(L"StringEmpty");
}
m_propertyName = name;
Modified: sandbox/adsk/vik/Common/Foundation/Data/PropertyDefinition.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Data/PropertyDefinition.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Data/PropertyDefinition.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -52,7 +52,7 @@
if (propType.empty())
{
- throw new MgException(L"MgPropertyDefinition.MgPropertyDefinition", __LINE__, __WFILE__, NULL, L"InvalidPropertyType", NULL);
+ throw new MgException(L"InvalidPropertyType");
}
m_propertyType = type;
Modified: sandbox/adsk/vik/Common/Foundation/Data/StringCollection.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Data/StringCollection.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Data/StringCollection.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -347,24 +347,14 @@
STRING buffer;
MgUtil::Int32ToString(index, buffer);
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgStringCollection.ValidateIndex",
- __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooBig", NULL);
+ throw new MgException(L"MgInvalidValueTooBig: " + buffer);
}
else if (index < 0)
{
STRING buffer;
MgUtil::Int32ToString(index, buffer);
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgStringCollection.ValidateIndex",
- __LINE__, __WFILE__, &arguments, L"MgInvalidValueTooSmall", NULL);
+ throw new MgException(L"MgInvalidValueTooSmall" + buffer);
}
}
Modified: sandbox/adsk/vik/Common/Foundation/Exception/Exception.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Exception/Exception.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Exception/Exception.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -25,32 +25,14 @@
/// \brief
/// Construct a MgException.
///
-MgException::MgException(CREFSTRING methodName, INT32 lineNumber,
- CREFSTRING fileName, MgStringCollection* whatArguments,
- CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw() :
+MgException::MgException(CREFSTRING whyMessageId) throw() :
m_whyMessageId(whyMessageId)
{
- MG_TRY()
+}
- AddStackTraceInfo(methodName, lineNumber, fileName);
-
- if (NULL != whatArguments)
- {
- for (INT32 i = 0; i < whatArguments->GetCount(); ++i)
- {
- m_whatArguments.Add(MgUtil::EncodeXss(whatArguments->GetItem(i)));
- }
- }
-
- if (NULL != whyArguments)
- {
- for (INT32 i = 0; i < whyArguments->GetCount(); ++i)
- {
- m_whyArguments.Add(MgUtil::EncodeXss(whyArguments->GetItem(i)));
- }
- }
-
- MG_CATCH_AND_RELEASE()
+ MgException::MgException(const wchar_t* whyMessageId) throw() :
+ m_whyMessageId(whyMessageId)
+{
}
///////////////////////////////////////////////////////////////////////////////
Modified: sandbox/adsk/vik/Common/Foundation/Exception/Exception.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Exception/Exception.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Exception/Exception.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -37,22 +37,11 @@
/// \brief
/// Construct the object.
///
- /// \param methodName
- /// Name of the method where the exception occurred.
- /// \param lineNumber
- /// Line number where the exception occurred.
- /// \param fileName
- /// File name where the exception occurred.
- /// \param whatArguments
- /// Collection of arguments used to format the message that describes what the exception is.
/// \param whyMessageId
/// ID of the message that describes why the exception occurs.
- /// \param whyArguments
- /// Collection of arguments used to format the message that describes why the exception occurs.
///
- MgException(CREFSTRING methodName, INT32 lineNumber,
- CREFSTRING fileName, MgStringCollection* whatArguments,
- CREFSTRING whyMessageId, MgStringCollection* whyArguments) throw();
+ MgException(CREFSTRING whyMessageId) throw();
+ MgException(const wchar_t* whyMessageId) throw();
///////////////////////////////////////////////////////////////////////////
Modified: sandbox/adsk/vik/Common/Foundation/Exception/ExceptionDefs.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Exception/ExceptionDefs.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Exception/ExceptionDefs.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -34,15 +34,14 @@
catch (MgException* e) \
{ \
mgException = e; \
- mgException->AddStackTraceInfo(methodName, mgStackParams, __LINE__, __WFILE__); \
} \
- catch (exception& ) \
+ catch (exception& ) \
{ \
- mgException = new MgException(methodName, __LINE__, __WFILE__, NULL, L"STL Exception", NULL); \
+ mgException = new MgException(L"STL Exception"); \
} \
catch (...) \
{ \
- mgException = new MgException(methodName, __LINE__, __WFILE__, NULL, L"", NULL); \
+ mgException = new MgException(L"Unknown"); \
} \
#define MG_THROW() \
Modified: sandbox/adsk/vik/Common/Foundation/Foundation.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Foundation.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Foundation.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -146,6 +146,10 @@
#include "System/ByteSourceFileImpl.h"
#include "System/ByteSourceMemoryImpl.h"
+#include "Data/MimeType.h"
+#include "System/ClassFactory.h"
+#include "System/ConfigurationSectionCollection.h"
+#include "System/ConfigurationHeap.h"
#else //WANT_ACE
@@ -162,11 +166,10 @@
#include "System/Object.h"
#include "System/Ptr.h"
#include "System/Disposable.h"
-#include "System/ClassFactory.h"
#include "System/GuardDisposable.h"
#include "System/Serializable.h"
#include "System/NamedSerializable.h"
-#include "Data/MimeType.h"
+
#include "Data/ByteReader.h"
#include "System/FoundationUnicodeString.h"
@@ -187,8 +190,6 @@
#include "System/Util.h"
#include "System/ConfigurationSection.h"
-#include "System/ConfigurationSectionCollection.h"
-#include "System/ConfigurationHeap.h"
#include "System/Configuration.h"
#include "System/Resources.h"
Modified: sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj 2011-12-08 20:58:31 UTC (rev 6322)
@@ -206,7 +206,6 @@
</ClCompile>
<ClCompile Include="Data\BatchPropertyCollection.cpp" />
<ClCompile Include="Data\Collection.cpp" />
- <ClCompile Include="Data\MimeType.cpp" />
<ClCompile Include="Data\NamedCollection.cpp" />
<ClCompile Include="Data\NullableProperty.cpp" />
<ClCompile Include="Data\Property.cpp" />
@@ -245,7 +244,6 @@
<ClInclude Include="Data\BatchPropertyCollection.h" />
<ClInclude Include="Data\Collection.h" />
<ClInclude Include="Data\FeaturePropertyType.h" />
- <ClInclude Include="Data\MimeType.h" />
<ClInclude Include="Data\NamedCollection.h" />
<ClInclude Include="Data\NullableProperty.h" />
<ClInclude Include="Data\Property.h" />
@@ -255,13 +253,9 @@
<ClInclude Include="Data\StringCollection.h" />
<ClInclude Include="Data\StringProperty.h" />
<ClInclude Include="stdafx.h" />
- <ClInclude Include="System\ArgumentPacket.h" />
- <ClInclude Include="System\BasicPacket.h" />
<ClInclude Include="System\BinaryStreamArgumentPacket.h" />
- <ClInclude Include="System\ByteSourceImpl.h" />
<ClInclude Include="System\CollectionPacket.h" />
<ClInclude Include="System\ConfigurationSection.h" />
- <ClInclude Include="System\ControlPacket.h" />
<ClInclude Include="System\ConvertUTF.h" />
<ClInclude Include="System\FoundationUnicodeString.h" />
<ClInclude Include="System\Mutex.h" />
@@ -273,14 +267,10 @@
<ClInclude Include="System\LinuxMemoryStatus.h" />
<ClInclude Include="System\NamedSerializable.h" />
<ClInclude Include="System\Object.h" />
- <ClInclude Include="System\OperationPacket.h" />
- <ClInclude Include="System\OperationResponsePacket.h" />
- <ClInclude Include="System\PacketStructure.h" />
<ClInclude Include="System\Ptr.h" />
<ClInclude Include="System\Resources.h" />
<ClInclude Include="System\Serializable.h" />
<ClInclude Include="System\SetLocale.h" />
- <ClInclude Include="System\StreamHeader.h" />
<ClInclude Include="System\Util.h" />
<ClInclude Include="Foundation.h" />
<ClInclude Include="FoundationDefs.h" />
Modified: sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj.filters
===================================================================
--- sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj.filters 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/Foundation.vcxproj.filters 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
- <Filter Include="Exception">
- <UniqueIdentifier>{7bb8909d-f0c8-42ac-99e9-89586e2d0203}</UniqueIdentifier>
- </Filter>
<Filter Include="Data">
<UniqueIdentifier>{a3028396-a081-4d9a-9c88-e68313baccf7}</UniqueIdentifier>
</Filter>
@@ -12,18 +9,12 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="Exception\Exception.cpp">
- <Filter>Exception</Filter>
- </ClCompile>
<ClCompile Include="Data\BatchPropertyCollection.cpp">
<Filter>Data</Filter>
</ClCompile>
<ClCompile Include="Data\Collection.cpp">
<Filter>Data</Filter>
</ClCompile>
- <ClCompile Include="Data\MimeType.cpp">
- <Filter>Data</Filter>
- </ClCompile>
<ClCompile Include="Data\NamedCollection.cpp">
<Filter>Data</Filter>
</ClCompile>
@@ -85,14 +76,9 @@
<Filter>System</Filter>
</ClCompile>
<ClCompile Include="stdafx.cpp" />
+ <ClCompile Include="Exception\Exception.cpp" />
</ItemGroup>
<ItemGroup>
- <ClInclude Include="Exception\Exception.h">
- <Filter>Exception</Filter>
- </ClInclude>
- <ClInclude Include="Exception\ExceptionDefs.h">
- <Filter>Exception</Filter>
- </ClInclude>
<ClInclude Include="Data\BatchPropertyCollection.h">
<Filter>Data</Filter>
</ClInclude>
@@ -102,9 +88,6 @@
<ClInclude Include="Data\FeaturePropertyType.h">
<Filter>Data</Filter>
</ClInclude>
- <ClInclude Include="Data\MimeType.h">
- <Filter>Data</Filter>
- </ClInclude>
<ClInclude Include="Data\NamedCollection.h">
<Filter>Data</Filter>
</ClInclude>
@@ -129,27 +112,15 @@
<ClInclude Include="Data\StringProperty.h">
<Filter>Data</Filter>
</ClInclude>
- <ClInclude Include="System\ArgumentPacket.h">
- <Filter>System</Filter>
- </ClInclude>
- <ClInclude Include="System\BasicPacket.h">
- <Filter>System</Filter>
- </ClInclude>
<ClInclude Include="System\BinaryStreamArgumentPacket.h">
<Filter>System</Filter>
</ClInclude>
- <ClInclude Include="System\ByteSourceImpl.h">
- <Filter>System</Filter>
- </ClInclude>
<ClInclude Include="System\CollectionPacket.h">
<Filter>System</Filter>
</ClInclude>
<ClInclude Include="System\ConfigurationSection.h">
<Filter>System</Filter>
</ClInclude>
- <ClInclude Include="System\ControlPacket.h">
- <Filter>System</Filter>
- </ClInclude>
<ClInclude Include="System\Disposable.h">
<Filter>System</Filter>
</ClInclude>
@@ -174,15 +145,6 @@
<ClInclude Include="System\Object.h">
<Filter>System</Filter>
</ClInclude>
- <ClInclude Include="System\OperationPacket.h">
- <Filter>System</Filter>
- </ClInclude>
- <ClInclude Include="System\OperationResponsePacket.h">
- <Filter>System</Filter>
- </ClInclude>
- <ClInclude Include="System\PacketStructure.h">
- <Filter>System</Filter>
- </ClInclude>
<ClInclude Include="System\Ptr.h">
<Filter>System</Filter>
</ClInclude>
@@ -195,9 +157,6 @@
<ClInclude Include="System\SetLocale.h">
<Filter>System</Filter>
</ClInclude>
- <ClInclude Include="System\StreamHeader.h">
- <Filter>System</Filter>
- </ClInclude>
<ClInclude Include="System\Util.h">
<Filter>System</Filter>
</ClInclude>
@@ -213,6 +172,8 @@
<Filter>System</Filter>
</ClInclude>
<ClInclude Include="stdafx.h" />
+ <ClInclude Include="Exception\Exception.h" />
+ <ClInclude Include="Exception\ExceptionDefs.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Foundation.rc" />
Deleted: sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,591 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-#include "AceStreamHelper.h"
-
-#if WANT_ACE
-
-/////////////////////////////////////////
-/// Globals
-
-INT32 MgAceStreamHelper::m_tcpPacketSize = 0;
-
-//-------------------------------------------------------------------------
-// Constructors/Destructors
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Constructs a MgAceStreamHelper object with the given handle.
-// </summary>
-//
-// <param name = "handle">
-// The ACE_HANDLE that this MgAceStreamHelper will be reading and writing.
-// </param>
-MgAceStreamHelper::MgAceStreamHelper( ACE_HANDLE handle )
-: MgStreamHelper(),
- m_readBufSize(0),
- m_readBuffer(NULL),
- m_readBufStart(0),
- m_readBufEnd(0),
- m_writeBufSize(0),
- m_writeBuffer(NULL),
- m_writeBufLength(0),
- m_handle(handle)
-{
-ACE_ASSERT( handle != 0 );
- if (m_tcpPacketSize == 0)
- {
- m_tcpPacketSize = 1460;
-
- MgConfiguration* config = MgConfiguration::GetInstance();
-
- config->GetIntValue(MgFoundationConfigProperties::GeneralPropertiesSection,
- MgFoundationConfigProperties::GeneralPropertyTcpIpMtu,
- m_tcpPacketSize,
- MgFoundationConfigProperties::DefaultGeneralPropertyTcpIpMtu);
-
- // MTU is a key parameter in our transmission scheme, make sure
- // the value specified is reasonable. If it isn't, default to
- // something we know is reasonable.
-
- if (m_tcpPacketSize < 40 || m_tcpPacketSize > 65000)
- {
- m_tcpPacketSize = MgFoundationConfigProperties::DefaultGeneralPropertyTcpIpMtu;
- }
- }
-
- // read buffer
- m_readBufSize = m_tcpPacketSize*10;
- m_readBuffer = new UINT8[m_readBufSize];
- m_readBufStart = 0;
- m_readBufEnd = 0;
-
- // write buffer
- m_writeBufSize = m_tcpPacketSize*5;
- m_writeBuffer = new UINT8[m_writeBufSize];
- m_writeBufLength = 0;
-};
-
-MgAceStreamHelper::MgAceStreamHelper()
-: MgStreamHelper(),
- m_readBufSize(0),
- m_readBuffer(NULL),
- m_readBufStart(0),
- m_readBufEnd(0),
- m_writeBufSize(0),
- m_writeBuffer(NULL),
- m_writeBufLength(0),
- m_handle(ACE_INVALID_HANDLE)
-{
-}
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// The destructor for a MgAceStreamHelper object.
-// </summary>
-MgAceStreamHelper::~MgAceStreamHelper()
-{
- delete[] m_readBuffer;
- m_readBuffer = NULL;
- m_readBufStart = 0;
- m_readBufEnd = 0;
- m_readBufSize = 0;
-
- delete [] m_writeBuffer;
- m_writeBuffer = NULL;
- m_writeBufLength = 0;
- m_writeBufSize = 0;
-};
-
-//-------------------------------------------------------------------------
-// Public Methods
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This method reads data from the stream into the given buffer. The
-// parameters control whether or not the read blocks, whether or not,
-// the caller wants to peek at the data, and if the caller wants to
-// know how many bytes had been read.
-// </summary>
-//
-// <param name = "buffer">
-// The buffer that will receive the data read from the stream.
-// </param>
-//
-// <param name = "size">
-// The size of the buffer in bytes of the buffer.
-// </param>
-//
-// <param name = "blocking">
-// True if the read request should block; false otherwise.
-// </param>
-//
-// <param name = "peeking">
-// True if the read request should not consume the data; false
-// otherwise.
-// </param>
-//
-// <param name = "bytesAvailable">
-// An out parameter that will contain the number of bytes that have been
-// read from the stream. It will contain -1 if there was an error.
-// </param>
-//
-// <returns>
-// Returns a MgStreamStatus value indicating the status of the operation.
-// </returns>
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::GetData(void* buffer,
- size_t size, bool blocking, bool peeking)
-{
- // Do not attempt reading zero byte from the socket as this could be problematic.
- if (0 == size)
- {
- return MgStreamHelper::mssDone;
- }
-
- ACE_ASSERT( size > 0 );
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssError;
-
- // Is our internal buffer big enough? If not, expand it.
- if ( m_readBufSize < size )
- {
- m_readBufSize = size;
- UINT8* temp = new UINT8[m_readBufSize];
- memcpy( temp, &m_readBuffer[m_readBufStart], m_readBufEnd - m_readBufStart );
- delete[] m_readBuffer;
- m_readBuffer = temp;
- m_readBufEnd -= m_readBufStart;
- m_readBufStart = 0;
- }
-
- // check if requested data is already in buffer
- stat = UpdateReadBuffers( buffer, size, peeking );
-
- if ( MgStreamHelper::mssDone != stat )
- {
- // We do not have enough data and will need to read. Shift buffer back
- // and attempt to fill the entire buffer with a non-blocking read first
- memmove(m_readBuffer, &m_readBuffer[m_readBufStart], m_readBufEnd-m_readBufStart);
- m_readBufEnd -= m_readBufStart;
- m_readBufStart = 0;
-
- ACE_SOCK_Stream stream;
- stream.set_handle( m_handle );
-
- // Windows has a timing problem. If trying to receive data too fast,
- // it will fail. So, use a timeout to let it catch up.
- // This workaround reduces the number of lockups significantly and
- // eliminates the hanging problem when it takes so long to write a
- // request to the socket.
- const ACE_Time_Value timeout(60);
-
- // On Linux, use MSG_NOSIGNAL to turn off raising of SIGPIPE on
- // stream sockets when the other end disappears.
- // Note that neither trapping the SIGPIPE signal via an
- // ACE_Event_Handler nor calling ACE_OS::signal(SIGPIPE, SIG_IGN)
- // seems to work.
- ssize_t res = stream.recv(&m_readBuffer[m_readBufEnd], m_readBufSize - m_readBufEnd, MG_MSG_NOSIGNAL, &timeout);
-
- if ( res < 0 )
- {
- // Check this return value to determine if the socket is closed or
- // if there was simply no data.
-#ifdef _WIN32
- int error = ::WSAGetLastError(); // errno doesn't work correctly on Windows
- bool bConnected = ( error == WSAEWOULDBLOCK || error == 0 );
-#else
- bool bConnected = ( errno == EWOULDBLOCK || errno == 0 || errno == ETIME );
-#endif
-
- stat = ( bConnected ) ? MgStreamHelper::mssNotDone : MgStreamHelper::mssError;
- }
- else if (res == 0)
- {
- // No longer connected
- stat = MgStreamHelper::mssError;
- }
- else
- {
- m_readBufEnd += res;
- // Now do we have enough data?
- stat = UpdateReadBuffers( buffer, size, peeking );
- }
-
- if (MgStreamHelper::mssNotDone == stat && blocking)
- {
- // Still not enough data. Have to block and fill only what was asked for.
- res = stream.recv_n(&m_readBuffer[m_readBufEnd], size - (m_readBufEnd-m_readBufStart), MG_MSG_NOSIGNAL);
-
- if ( res < 0 )
- {
- // Check this return value to determine if the socket is closed or
- // if there was simply no data.
-#ifdef _WIN32
- int error = ::WSAGetLastError(); // errno doesn't work correctly on Windows
- bool bConnected = ( error == WSAEWOULDBLOCK || error == 0 );
-#else
- bool bConnected = ( errno == EWOULDBLOCK || errno == 0 || errno == ETIME );
-#endif
-
- stat = ( bConnected ) ? MgStreamHelper::mssNotDone : MgStreamHelper::mssError;
- }
- else if (res == 0)
- {
- // No longer connected
- stat = MgStreamHelper::mssError;
- }
- else
- {
- m_readBufEnd += res;
- // Now we better have enough data...
- stat = UpdateReadBuffers( buffer, size, peeking );
- }
- }
- }
-
- return stat;
-}
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::UpdateReadBuffers( void* buffer, size_t size, bool peeking)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssNotDone;
-
- if ((m_readBufEnd - m_readBufStart) >= size)
- {
- // update output data
- memcpy( buffer, &m_readBuffer[m_readBufStart], size );
-
- if ( !peeking )
- {
- m_readBufStart += size;
- if (m_readBufStart == m_readBufEnd)
- {
- // Empty buffer, reset
- m_readBufStart = 0;
- m_readBufEnd = 0;
- }
- }
-
- stat = MgStreamHelper::mssDone;
- }
- return stat;
-}
-
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Reads a UINT8 from the stream.
-// </summary>
-//
-// <param name = "data">
-// An out parameter that holds the UINT8 read from the stream.
-// </param>
-//
-// <param name = "blocking">
-// True if the read request should block; false otherwise.
-// </param>
-//
-// <param name = "peeking">
-// True if the read request should not consume the data; false
-// otherwise.
-// </param>
-//
-// <returns>
-// Returns a MgStreamStatus value indicating the status of the operation.
-// </returns>
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::GetUINT8( UINT8& data, bool blocking, bool peeking )
-{
- return GetData( &data, sizeof(data), blocking, peeking );
-};
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::GetUINT16( UINT16& data, bool blocking, bool peeking )
-{
- INT16 nValue = 0;
-
- MgStreamHelper::MgStreamStatus stat = GetData( &nValue, sizeof(INT16), blocking, peeking );
-
- data = MG_NTOHS(nValue);
-
- return stat;
-}
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Reads a UINT32 from the stream.
-// </summary>
-//
-// <param name = "data">
-// An out parameters that holds the UINT32 read from the stream.
-// </param>
-//
-// <param name = "blocking">
-// True if the read request should block; false otherwise.
-// </param>
-//
-// <param name = "peeking">
-// True if the read request should not consume the data; false
-// otherwise.
-// </param>
-//
-// <returns>
-// Returns a MgStreamStatus value indicating the status of the operation.
-// </returns>
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::GetUINT32( UINT32& data, bool blocking, bool peeking )
-{
- UINT32 intData = 0;
- MgStreamHelper::MgStreamStatus stat = GetData( &intData, sizeof(intData), blocking, peeking );
- data = MG_NTOHL(intData);
- return stat;
-};
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::GetINT64( INT64& data, bool blocking, bool peeking )
-{
- data = 0;
-
- UINT32 lowWord;
- UINT32 hiWord;
-
- MgStreamHelper::MgStreamStatus stat = GetUINT32(lowWord, blocking, peeking);
- if (MgStreamHelper::mssDone == stat) { stat = GetUINT32(hiWord, blocking, peeking); }
-
- if (MgStreamHelper::mssDone == stat) { data = (((INT64)hiWord) << 32) | lowWord; }
-
- return stat;
-}
-
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This method writes data from the given buffer to the underlying stream.
-// It can block or not, depending on the value of the blocking parameter.
-// </summary>
-//
-// <param name = "buffer">
-// The buffer that contains the data to be written.
-// </param>
-//
-// <param name = "size">
-// The size of the buffer in bytes of the buffer.
-// </param>
-//
-// <param name = "blocking">
-// True if the write request should block; false otherwise.
-// </param>
-//
-// <param name = "bytesWritten">
-// An out parameter that will contain the number of bytes that have been
-// written to the stream.
-// </param>
-//
-// <returns>
-// Returns a MgStreamStatus value indicating the status of the operation.
-// </returns>
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::WriteData(void* buffer,
- size_t size, bool blocking, size_t* bytesWritten)
-{
- // Do not attempt writing zero byte to the socket as this could be problematic.
- if (0 == size)
- {
- return MgStreamHelper::mssDone;
- }
-
- ACE_ASSERT( buffer && size > 0 );
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssError;
-
- // check parameters
- if ( buffer && size > 0 )
- {
- // init out parameter
- if ( bytesWritten != NULL )
- *bytesWritten = 0;
-
- ACE_SOCK_Stream stream;
- stream.set_handle( m_handle );
-
- ssize_t res = 0;
-
- // On Linux, use MSG_NOSIGNAL to request not to send SIGPIPE on
- // errors on stream oriented sockets when the other end breaks
- // the connection. The EPIPE error is still returned.
- // Note that neither trapping the SIGPIPE signal via an
- // ACE_Event_Handler nor calling ACE_OS::signal(SIGPIPE, SIG_IGN)
- // seems to work.
-
- if ( blocking )
- {
- res = stream.send_n(buffer, size, MG_MSG_NOSIGNAL);
- }
- else
- {
- res = stream.send(buffer, size, MG_MSG_NOSIGNAL);
- }
-
- // check for failure
- if ( res >= 0 )
- {
- // update out parameter
- if ( bytesWritten != NULL )
- *bytesWritten = res;
-
- if ( res == (ssize_t)size )
- {
- stat = MgStreamHelper::mssDone;
- }
- else
- {
- stat = blocking ? MgStreamHelper::mssError : MgStreamHelper::mssNotDone;
- }
- }
- }
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Recursive routine to write an arbitrarily large input buffer to the stream
-/// If the input fits in our internal buffer, just use the internal buffer.
-///</summary>
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::WriteBytes(const unsigned char* buf, int nBytes)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- if (nBytes + m_writeBufLength >= m_writeBufSize)
- {
- // We cannot fit everything in the buffer.
- // Fill the buffer completely and write it to the helper.
- size_t fillBytes = m_writeBufSize - m_writeBufLength;
- memcpy(&m_writeBuffer[m_writeBufLength], buf, fillBytes);
- m_writeBufLength += fillBytes;
-
- size_t bytesWritten = 0;
-
- stat = WriteData(m_writeBuffer, m_writeBufLength, true, &bytesWritten);
-
- // shift output buffer back
- if (bytesWritten > 0)
- {
- memmove(m_writeBuffer, &m_writeBuffer[bytesWritten], m_writeBufLength-bytesWritten);
- m_writeBufLength -= bytesWritten;
- }
-
- // and recurse to push more data in
- if (MgStreamHelper::mssError != stat)
- {
- stat = WriteBytes(&buf[fillBytes], nBytes-(int)fillBytes);
- }
- }
- else
- {
- // We have enough room in our internal buffer so just append
- memcpy(&m_writeBuffer[m_writeBufLength], buf, nBytes);
- m_writeBufLength += nBytes;
- }
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Flushes internal memory buffer to stream helper. This method
-/// should be called once an entire packet has been assembled.
-///</summary>
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::Flush()
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssNotDone;
- while (m_writeBufLength > 0 && MgStreamHelper::mssError != stat)
- {
- size_t bytesWritten = 0;
- stat = WriteData(m_writeBuffer, m_writeBufLength, true, &bytesWritten);
-
- // shift output buffer back
- if (bytesWritten > 0)
- {
- memmove(m_writeBuffer, &m_writeBuffer[bytesWritten], m_writeBufLength-bytesWritten);
- m_writeBufLength -= bytesWritten;
- }
- }
- return stat;
-}
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::WriteUINT8( UINT8 value )
-{
- return WriteBytes((unsigned char*)&value, sizeof(UINT8));
-}
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::WriteUINT32( UINT32 value )
-{
- UINT32 tcpValue = MG_HTONL(value);
- return WriteBytes((unsigned char*)&tcpValue, sizeof(UINT32));
-}
-
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::WriteUINT16( UINT16 value )
-{
- UINT16 tcpValue = MG_HTONS(value);
- return WriteBytes((unsigned char*)&tcpValue, sizeof(UINT16));
-}
-
-MgStreamHelper::MgStreamStatus MgAceStreamHelper::WriteINT64( INT64 value )
-{
- UINT32 word = (UINT32) (value & 0xFFFFFFFF);
- MgStreamHelper::MgStreamStatus stat = WriteUINT32(word);
-
- word = (UINT32)((value >> 32) & 0xFFFFFFFF);
- if (MgStreamHelper::mssDone == stat) stat = WriteUINT32(word);
-
- return stat;
-}
-
-void MgAceStreamHelper::Dispose()
-{
- delete this;
-}
-
-bool MgAceStreamHelper::IsConnected()
-{
- bool bConnected = true;
- ACE_SOCK_Stream stream;
- stream.set_handle( m_handle );
- UINT8 dummy;
- ACE_Time_Value val(0, 0);
- ssize_t res = stream.recv_n(&dummy, 1, MSG_PEEK | MG_MSG_NOSIGNAL, &val);
-
- if ( res < 0 )
- {
- // Error or timeout occured
-#ifdef _WIN32
- int error = ::WSAGetLastError(); // errno doesn't work correctly on Windows
- bConnected = ( error == WSAEWOULDBLOCK || error == 0 );
-#else
- bConnected = ( errno == EWOULDBLOCK || errno == 0 || errno == ETIME );
-#endif
- }
- else if (res == 0)
- {
- // No longer connected
- bConnected = false;
- }
-
- return bConnected;
-}
-
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/AceStreamHelper.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,164 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGACESTREAMHELPER_H_
-#define MGACESTREAMHELPER_H_
-
-#include "StreamHelper.h"
-
-class MgAceStreamHelper;
-
-#if WANT_ACE
-template class MG_FOUNDATION_API Ptr<MgAceStreamHelper>;
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////
-/// \brief
-/// The MgAceStreamHelper class provides an interface to read and write data
-/// from an underlying ACE data stream.
-class MG_FOUNDATION_API MgAceStreamHelper : public MgStreamHelper
-{
- DECLARE_CLASSNAME(MgAceStreamHelper)
-
- ///////////////////////////////////////////////////////////////////////
- /// Constructors/Destructors
- public:
- MgAceStreamHelper();
- MgAceStreamHelper( ACE_HANDLE handle );
- virtual ~MgAceStreamHelper();
-
- ///////////////////////////////////////////////////////////////////////
- /// Methods
- public:
-
- ////////////////////////////////////
- ////////////////////////////////////
- /// Buffered Reader Methods
- MgStreamStatus GetUINT8( UINT8& data, bool blocking = true, bool peeking = false );
-
- MgStreamStatus GetUINT16( UINT16& data, bool blocking = true, bool peeking = false );
-
- MgStreamStatus GetUINT32( UINT32& data, bool blocking = true, bool peeking = false );
-
- MgStreamStatus GetINT64( INT64& data, bool blocking = true, bool peeking = false );
-
- ////////////////////////////////////
- ////////////////////////////////////
- /// Cached Writing Methods
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a byte.
- ///
- /// \param value
- /// 8 bit byte to write
- ///
- MgStreamStatus WriteUINT8( UINT8 value );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a TCP/IP 16 bit integer. This routine should make our
- /// data transfer platform independent
- ///
- /// \param value
- /// 16 bit integer to write
- ///
- MgStreamStatus WriteUINT16( UINT16 value );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a TCP/IP 32 bit integer. This routine should make our
- /// data transfer platform independent
- ///
- /// \param value
- /// 32 bit integer to write
- ///
- MgStreamStatus WriteUINT32( UINT32 value );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a TCP/IP 64 bit integer. This routine should make our
- /// data transfer platform independent
- ///
- /// \param value
- /// 64 bit integer to write
- ///
- MgStreamStatus WriteINT64( INT64 value );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Flushes internal memory buffer to stream helper. This method
- /// should be called once an entire packet has been assembled.
- ///
- MgStreamStatus Flush();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns whether or not stream is connected.
- ///
- bool IsConnected();
-
- protected:
-
- void Dispose();
-
-private:
-
- ///////////////////////////////////////////////////////////////////////
- /// Private Functions
-
- MgStreamStatus GetData( void* buffer, size_t size, bool blocking = true, bool peeking = false );
-
- MgStreamStatus WriteData( void* buffer, size_t size, bool blocking = true, size_t* bytesWritten = NULL );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Recursive routine to write an arbitrarily large input buffer to the stream
- /// If the input fits in our internal buffer, just use the internal buffer.
- ///
- MgStreamStatus WriteBytes(const unsigned char* buf, int nBytes);
-
- MgStreamStatus UpdateReadBuffers( void* buffer, size_t size, bool peeking);
-
- ///////////////////////////////////////////////////////////////////////
- /// Member Variables
-
- ///////////////////////////////////////////////////////////////////////
- /// Member Variables
-
- /// Read buffer variables
- size_t m_readBufSize;
- UINT8* m_readBuffer;
- size_t m_readBufStart;
- size_t m_readBufEnd;
-
- /// Write buffer variables
- size_t m_writeBufSize;
- UINT8* m_writeBuffer;
- size_t m_writeBufLength;
-
- /// the handle to the stream
- const ACE_HANDLE m_handle;
-
- /// TCP/IP packet size
- static INT32 m_tcpPacketSize;
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MGACESTREAMHELPER_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/ArgumentPacket.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ArgumentPacket.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ArgumentPacket.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,48 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGARGUMENTPACKET_H_MG
-#define MGARGUMENTPACKET_H_MG
-
-#include "BasicPacket.h"
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////
-// Argument Packet Wrapper Structure
-struct MgArgumentPacket : public MgBasicPacket
-{
- MgArgumentPacket()
- :
- m_ArgumentType(0),
- m_pData(NULL),
- m_Length(0)
- {
- }
-
- virtual ~MgArgumentPacket()
- {
- delete[] m_pData;
- m_pData = NULL;
- }
-
- UINT32 m_ArgumentType;
- UINT8* m_pData;
- INT64 m_Length;
-};
-/// \endcond
-
-#endif // MGARGUMENTPACKET_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/BasicPacket.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/BasicPacket.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/BasicPacket.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,35 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGBASICPACKET_H_MG
-#define MGBASICPACKET_H_MG
-
-/// \cond INTERNAL
-// Basic Packet Wrapper Structure
-struct MgBasicPacket
-{
- MgBasicPacket()
- :
- m_PacketHeader(0)
- {
- }
-
- UINT32 m_PacketHeader;
-};
-/// \endcond
-
-#endif // MGBASICPACKET_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,144 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Construct a ByteSourceFileImpl object
-///</summary>
-///<param name="filename">Name of the file</param>
-///
-ByteSourceFileImpl::ByteSourceFileImpl(CREFSTRING filename, bool temporary) :
- m_file(ACE_INVALID_HANDLE),
- m_size(0),
- m_temporary(temporary)
-{
- LoadFile(filename);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Destruct a ByteSourceFileImpl object
-///</summary>
-///
-ByteSourceFileImpl::~ByteSourceFileImpl()
-{
- ACE_OS::close(m_file);
- m_file = ACE_INVALID_HANDLE;
- m_size = 0;
- if (m_temporary)
- {
- ACE_OS::unlink(MG_WCHAR_TO_TCHAR(m_name));
- }
- m_name = L"";
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Reads a buffer of data
-///</summary>
-///<param name="buffer">
-/// A buffer receiving the data.
-///</param>
-///<param name="length">
-///Maximum number of bytes to read
-///</param>
-///<returns>Actual number of bytes put in the buffer. 0 means end of bytes</returns>
-///
-INT32 ByteSourceFileImpl::Read(BYTE_ARRAY_OUT buffer, INT32 length)
-{
- INT32 bytesRead = (INT32)ACE_OS::read(m_file, buffer, length);
-
- if (bytesRead < 0)
- {
- throw new MgFileIoException(L"ByteSourceFileImpl.Read",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_size -= bytesRead;
-
- return bytesRead;
-}
-
-INT64 ByteSourceFileImpl::GetLength()
-{
- return m_size;
-}
-
-bool ByteSourceFileImpl::IsRewindable()
-{
- return true;
-}
-
-void ByteSourceFileImpl::Rewind()
-{
- m_size = ACE_OS::llseek(m_file, 0, SEEK_END);
- ACE_OS::llseek(m_file, 0, SEEK_SET);
-}
-
-void ByteSourceFileImpl::Rename(CREFSTRING newName)
-{
- if (m_temporary == false)
- {
- throw new MgInvalidOperationException(L"ByteSourceFileImpl.Rename",
- __LINE__,__WFILE__, NULL, L"", NULL);
- }
-
- ACE_OS::close(m_file);
- m_file = ACE_INVALID_HANDLE;
-
- ACE_OS::rename(MG_WCHAR_TO_TCHAR(m_name), MG_WCHAR_TO_TCHAR(newName));
-
- m_name = L"";
- m_size = 0;
- m_temporary = false;
-
- LoadFile(newName);
-}
-
-void ByteSourceFileImpl::LoadFile(CREFSTRING filename)
-{
- //Use ACE open insted of _wfopen to allow Linux compatibility
- m_file = ACE_OS::open(MG_WCHAR_TO_TCHAR(filename), 0, ACE_DEFAULT_OPEN_PERMS, 0);
- if(m_file == ACE_INVALID_HANDLE)
- {
- MgStringCollection arguments;
- arguments.Add(filename);
-
- if(errno == ENOENT)
- {
- throw new MgFileNotFoundException(L"ByteSourceFileImpl.LoadFile",
- __LINE__, __WFILE__, &arguments, L"", NULL);
- }
- else
- {
- throw new MgFileIoException(L"ByteSourceFileImpl.LoadFile",
- __LINE__, __WFILE__, &arguments, L"", NULL);
- }
- }
-
- m_size = ACE_OS::llseek(m_file, 0, SEEK_END);
- ACE_OS::llseek(m_file, 0, SEEK_SET);
-
- m_name = filename;
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceFileImpl.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,132 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_BYTE_SOURCE_FILE_IMPL_H_
-#define MG_BYTE_SOURCE_FILE_IMPL_H_
-
-#if WANT_ACE
-
-/// \cond INTERNAL
-/////////////////////////////////////////////////////////////////
-/// \brief
-/// ByteSourceMemoryImpl provides access to the bytes on a file source
-///
-/// INTERNAL_CLASS - NOT EXPOSED
-///
-class ByteSourceFileImpl : public ByteSourceImpl
-{
- DECLARE_CLASSNAME(ByteSourceFileImpl)
-
-public:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Construct a ByteSourceFileImpl object
- ///
- /// \param filename
- /// Name of the file
- ///
- ByteSourceFileImpl(CREFSTRING filename, bool temporary = false);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destruct a ByteSourceFileImpl object
- ///
- virtual ~ByteSourceFileImpl();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Determines whether or not the byte source is from a temporary file.
- ///
- /// \return
- /// true if the byte source is from a temporary file, false otherwise.
- ///
- bool IsTemporary() const;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Reads a buffer
- ///
- /// \param buffer
- /// A buffer receiving the data.
- /// \param length
- /// Maximum number of bytes to read
- ///
- /// \return
- /// Actual number of bytes put in the buffer. 0 means end of bytes
- ///
- INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length);
-
- INT64 GetLength();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Determines if the source is rewindable.
- ///
- /// \return
- /// true if the source is rewindable, false otherwise.
- ///
- bool IsRewindable();
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Rewinds to the start of file. File length is reset.
- ///
- /// \return
- /// Nothing
- ///
- void Rewind();
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Renames the file. File is renamed to the new name and
- /// rewound to start of file. Rename is only allowed on
- /// temporary files (see constructor).
- ///
- /// \param newName
- /// New name for file
- ///
- /// \return
- /// Nothing
- ///
- /// \exception MgInvalidOperationException if file is not temporary
- ///
- void Rename(CREFSTRING newName);
-
-protected:
-
- void LoadFile(CREFSTRING name);
-
- STRING m_name;
- ACE_HANDLE m_file;
- INT64 m_size;
- bool m_temporary;
-};
-/// \endcond
-
-
-/// Inline Methods
-/// \cond INTERNAL
-inline bool ByteSourceFileImpl::IsTemporary() const
-{
- return m_temporary;
-}
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MG_BYTE_SOURCE_FILE_IMPL_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceImpl.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceImpl.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceImpl.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,89 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_BYTE_SOURCE_IMPL_H_
-#define MG_BYTE_SOURCE_IMPL_H_
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////////
-/// \brief
-/// Placeholder for various ByteSourceInfo derived classes, which supply
-/// the actual access to the bytes in the source
-class ByteSourceImpl
-{
-public:
-
- /// Constructor
- ByteSourceImpl() {}
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Destruct a ByteSourceImpl object
- ///
- virtual ~ByteSourceImpl() {}
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Reads a buffer
- ///
- /// \param buffer
- /// A buffer receiving the data.
- /// \param length
- /// Maximum number of bytes to read
- ///
- /// \return
- /// Actual number of bytes put in the buffer. 0 means end of bytes
- ///
- virtual INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length) = 0;
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns the remaining length of the byte source. This length is
- /// adjusted for previous reads. If the returned length is zero
- /// then the underlying source may be a streaming format and the length
- /// is not known.
- ///
- /// \return
- /// Remaining length of the byte source
- ///
- virtual INT64 GetLength() = 0;
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Determines if the source is rewindable.
- ///
- /// \return
- /// true if the source is rewindable, false otherwise.
- ///
- virtual bool IsRewindable() = 0;
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Rewinds to the start of the source. Depending on the source of
- /// the reader, Rewind may not be supported. Readers sourced from
- /// true streams cannot be rewound.
- ///
- /// \return
- /// Nothing
- ///
- /// \exception MgInvalidOperationException if source cannot be rewound
- ///
- virtual void Rewind() = 0;
-};
-/// \endcond
-
-#endif // MG_BYTE_SOURCE_IMPL_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,106 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Construct a ByteSourceMemoryImpl object
-///</summary>
-///<param name="data">Memory data source</param>
-///<param name="length">Data length</param>
-///
-ByteSourceMemoryImpl::ByteSourceMemoryImpl(BYTE_ARRAY_IN data, INT32 length)
-{
- //make a copy of the memory
- m_data = new MgByte(data, length);
-
- if(m_data == NULL)
- {
- throw new MgOutOfMemoryException(L"ByteSourceMemoryImpl.ByteSourceMemoryImpl",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_pos = 0;
-}
-
-ByteSourceMemoryImpl::ByteSourceMemoryImpl(MgByte* data)
-{
- m_data = SAFE_ADDREF(data);
- m_pos = 0;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Destruct a ByteSourceMemoryImpl object
-///</summary>
-///
-ByteSourceMemoryImpl::~ByteSourceMemoryImpl()
-{
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Reads a buffer of data
-///</summary>
-///<param name="buffer">
-/// A buffer receiving the data.
-///</param>
-///<param name="length">
-///Maximum number of bytes to read
-///</param>
-///<returns>Actual number of bytes put in the buffer. 0 means end of bytes</returns>
-///
-INT32 ByteSourceMemoryImpl::Read(BYTE_ARRAY_OUT buffer, INT32 length)
-{
- if (m_data == NULL)
- return 0;
- INT32 remaining = m_data->GetLength() - m_pos;
- if(remaining == 0)
- return 0;
-
- INT32 bytesCopied = remaining > length? length: remaining;
- m_data->Read(buffer, m_pos, bytesCopied);
- m_pos += bytesCopied;
-
- return bytesCopied;
-}
-
-INT64 ByteSourceMemoryImpl::GetLength()
-{
- return (m_data == NULL)? 0 : m_data->GetLength() - m_pos;
-}
-
-bool ByteSourceMemoryImpl::IsRewindable()
-{
- return true;
-}
-
-void ByteSourceMemoryImpl::Rewind()
-{
- m_pos = 0;
-}
-
-MgByte* ByteSourceMemoryImpl::Bytes()
-{
- return (SAFE_ADDREF((MgByte*)m_data));
-}
-
-#endif //WANT_ACE
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceMemoryImpl.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,124 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_BYTE_SOURCE_MEMORY_IMPL_H_
-#define MG_BYTE_SOURCE_MEMORY_IMPL_H_
-
-/// INTERNAL_CLASS - NOT EXPOSED
-/// \cond INTERNAL
-#if WANT_ACE
-
-class MgByte;
-template class MG_FOUNDATION_API Ptr<MgByte>;
-
-/////////////////////////////////////////////////////////////////
-/// \brief
-/// ByteSourceMemoryImpl provides access to the bytes on a memory source
-class ByteSourceMemoryImpl : public ByteSourceImpl
-{
- DECLARE_CLASSNAME(ByteSourceMemoryImpl)
-
-public:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Construct a ByteSourceMemoryImpl object
- ///
- /// \param data
- /// Memory data source
- /// \param length
- /// Data length
- ///
- ByteSourceMemoryImpl(BYTE_ARRAY_IN data, INT32 length);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Construct a ByteSourceMemoryImpl object
- ///
- /// \param data
- /// MgByte object to use
- ///
- ByteSourceMemoryImpl(MgByte* data);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destruct a ByteSourceMemoryImpl object
- ///
- virtual ~ByteSourceMemoryImpl();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Reads a buffer
- ///
- /// \param buffer
- /// A buffer receiving the data.
- /// \param length
- /// Maximum number of bytes to read
- ///
- /// \return
- /// Actual number of bytes put in the buffer. 0 means end of bytes
- ///
- INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length);
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns the remaining length of the byte source. This length is
- /// adjusted for previous reads. If the returned length is zero
- /// then the underlying source may be a streaming format and the length
- /// is not known.
- ///
- /// \return
- /// Remaining length of the byte source
- ///
- INT64 GetLength();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Determines if the source is rewindable.
- ///
- /// \return
- /// true if the source is rewindable, false otherwise.
- ///
- bool IsRewindable();
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Rewinds to the start of memory. Length is reset.
- ///
- /// \return
- /// Nothing
- ///
- void Rewind();
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns a reference to the internal MgByte object
- ///
- /// \return
- /// Internal MgByte
- ///
- MgByte* Bytes();
-
-protected:
- Ptr<MgByte> m_data;
- INT32 m_pos;
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MG_BYTE_SOURCE_MEMORY_IMPL_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,207 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-/// INTERNAL_CLASS - NOT EXPOSED
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-#include "ServerConnectionBase.h"
-#include "ByteSourceStreamImpl.h"
-#include "ByteSourceSocketStreamImpl.h"
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Construct a ByteSourceSocketStreamImpl object
-///</summary>
-///<param name="length">Length of the stream</param>
-///<param name="conn">Map server connection</param>
-///
-ByteSourceSocketStreamImpl::ByteSourceSocketStreamImpl(INT64 length, MgServerConnectionBase* conn)
-:
-m_len(length),
-m_pos(0),
-m_blockSize(0),
-m_blockRead(0)
-{
- m_conn = conn;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-///Destroy ByteSourceSocketStreamImpl object
-///</summary>
-///
-ByteSourceSocketStreamImpl::~ByteSourceSocketStreamImpl()
-{
- MG_TRY()
-
- Close();
-
- MG_CATCH_AND_RELEASE()
-}
-
-void ByteSourceSocketStreamImpl::Close()
-{
- if (m_conn != NULL)
- {
- // Read everything out of the stream. Developers
- // may not pull the entire stream before dumping
- // the MgByteReader.
- INT32 nBytes = 0;
- unsigned char buf[1024];
- do
- {
- nBytes = Read(buf, 1024);
- }
- while (nBytes > 0);
-
- m_conn = NULL;
- }
- m_len = 0;
- m_pos = 0;
- m_blockSize = 0;
- m_blockRead = 0;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Reads a buffer
-///</summary>
-///<param name="buffer">
-/// A buffer receiving the data.
-///</param>
-///<param name="length">
-///Maximum number of bytes to read
-///</param>
-///<returns>Actual number of bytes put in the buffer. 0 means end of bytes</returns>
-INT32 ByteSourceSocketStreamImpl::Read(BYTE_ARRAY_OUT buffer, INT32 length)
-{
- if (m_conn == NULL)
- {
- return 0;
- }
-
- INT32 bytesRead = 0;
-
- MG_TRY()
-
- INT64 remaining = m_len - m_pos;
- INT32 toReceive = remaining > (INT64) length ? length : (INT32) remaining;
-
- Ptr<MgStream> stream = m_conn->GetStream();
- Ptr<MgStreamHelper> helper = stream->GetStreamHelper();
-
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssError;
-
- // Read block size if required
- if (m_blockSize == 0)
- {
- UINT32 len = 0;
- helper->GetUINT32( len, true, false );
- m_blockSize = (INT32) len;
- m_blockRead = 0;
- }
-
- if (m_blockSize == 0)
- {
- helper = NULL;
- stream->GetStreamEnd();
- stream = NULL;
- m_conn = NULL;
- return 0;
- }
-
- // We cannot read through input stream block boundaries
- if (toReceive <= m_blockSize - m_blockRead)
- {
- // We are ok. Just read what's there and increment counts
- stat = helper->GetData(buffer, toReceive);
-
- if (stat != MgStreamHelper::mssDone)
- {
- throw new MgStreamIoException(L"ByteSourceSocketStreamImpl.Read",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_blockRead += toReceive;
- bytesRead = toReceive;
-
- if (m_blockSize == m_blockRead)
- {
- m_blockSize = 0;
- m_blockRead = 0;
- }
- }
- else
- {
- // Fill with the remainder of the block
- INT32 blockRemain = m_blockSize - m_blockRead;
- if (blockRemain > 0)
- {
- stat = helper->GetData(buffer, blockRemain);
-
- if (stat != MgStreamHelper::mssDone)
- {
- throw new MgStreamIoException(L"ByteSourceSocketStreamImpl.Read",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- bytesRead = blockRemain;
- }
-
- m_blockSize = 0;
- m_blockRead = 0;
- }
-
- m_pos += bytesRead;
-
- // When reaching the end of the stream, release the currently acquired
- // connection and return it to the pool. This will prevent the connection
- // pool from getting exhausted if the .NET or Java's garbage collector does
- // not do its job fast enough.
- if (m_pos == m_len)
- {
- helper = NULL;
- stream = NULL;
- Close();
- }
-
- MG_CATCH_AND_THROW(L"ByteSourceSocketStreamImpl.Read")
-
- return bytesRead;
-}
-
-INT64 ByteSourceSocketStreamImpl::GetLength()
-{
- return m_len - m_pos;
-}
-
-bool ByteSourceSocketStreamImpl::IsRewindable()
-{
- return false;
-}
-
-void ByteSourceSocketStreamImpl::Rewind()
-{
- throw new MgInvalidOperationException(L"ByteSourceSocketStreamImpl.Rewind",
- __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceSocketStreamImpl.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,113 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_BYTE_SOURCE_SOCKET_STREAM_IMPL_H_
-#define MG_BYTE_SOURCE_SOCKET_STREAM_IMPL_H_
-
-#if WANT_ACE
-
-/// INTERNAL_CLASS - NOT EXPOSED
-/// \cond INTERNAL
-
-/////////////////////////////////////////////////////////////////
-/// \brief
-/// ByteSourceSocketStreamImpl provides access to the bytes on a file source
-class ByteSourceSocketStreamImpl : public ByteSourceImpl
-{
- DECLARE_CLASSNAME(ByteSourceSocketStreamImpl)
-
-INTERNAL_API:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Construct a ByteSourceSocketStreamImpl object
- ///
- /// \param serverConn
- /// server connection
- ///
- ByteSourceSocketStreamImpl(INT64 len, MgServerConnectionBase* serverConn);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destroy ByteSourceSocketStreamImpl object
- ///
- virtual ~ByteSourceSocketStreamImpl();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Reads a buffer
- ///
- /// \param buffer
- /// A buffer receiving the data.
- /// \param length
- /// Maximum number of bytes to read
- ///
- /// \return
- /// Actual number of bytes put in the buffer. 0 means end of bytes
- ///
- INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length);
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns the remaining length of the byte source. This length is
- /// adjusted for previous reads. If the returned length is zero
- /// then the underlying source may be a streaming format and the length
- /// is not known.
- ///
- /// \return
- /// Remaining length of the byte source
- ///
- INT64 GetLength();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Determines if the source is rewindable.
- ///
- /// \return
- /// true if the source is rewindable, false otherwise.
- ///
- bool IsRewindable();
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Rewinds to the start of the source. This implementation
- /// does not support rewind.
- ///
- /// \return
- /// Nothing
- ///
- /// \exception MgInvalidOperationException will be thrown since socket stream cannot be rewound
- ///
- void Rewind();
-
-private:
-
- void Close();
-
-protected:
- Ptr<MgServerConnectionBase> m_conn;
- INT64 m_len;
- INT64 m_pos;
- INT32 m_blockSize;
- INT32 m_blockRead;
-};
-
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MG_BYTE_SOURCE_SOCKET_STREAM_IMPL_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,98 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-
-/// INTERNAL_CLASS - NOT EXPOSED
-#if WANT_ACE
-#include "Foundation.h"
-#include "ByteSourceStreamImpl.h"
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Construct a ByteSourceMgStreamImpl object
-///</summary>
-///<param name="stream">ACE socket stream</param>
-///<param name="length">Length of the stream</param>
-///
-ByteSourceMgStreamImpl::ByteSourceMgStreamImpl(MgStream* stream)
-{
- if (stream == NULL)
- {
- throw new MgNullReferenceException(L"ByteSourceMgStreamImpl.ByteSourceMgStreamImpl",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_stream = SAFE_ADDREF(stream);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Construct a ByteSourceMgStreamImpl object
-///</summary>
-///<param name="stream">ACE socket stream</param>
-///<param name="length">Length of the stream</param>
-///
-ByteSourceMgStreamImpl::~ByteSourceMgStreamImpl()
-{
- SAFE_RELEASE(m_stream);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Reads a buffer
-///</summary>
-///<param name="buffer">
-/// A buffer receiving the data.
-///</param>
-///<param name="length">
-///Maximum number of bytes to read
-///</param>
-///<returns>Actual number of bytes put in the buffer. 0 means end of bytes</returns>
-INT32 ByteSourceMgStreamImpl::Read(BYTE_ARRAY_OUT buffer, INT32 length)
-{
- // Read data for the specified length
- INT32 bytesReceived = m_stream->GetData(buffer, length);
-
- if (bytesReceived == -1)
- {
- throw new MgStreamIoException(L"ByteSourceMgStreamImpl.Read",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- //nRecv = -errno;
- return bytesReceived;
-}
-
-
-INT64 ByteSourceMgStreamImpl::GetLength()
-{
- // Streaming format - we do not know the length;
- return 0;
-}
-
-bool ByteSourceMgStreamImpl::IsRewindable()
-{
- return false;
-}
-
-void ByteSourceMgStreamImpl::Rewind()
-{
- throw new MgInvalidOperationException(L"ByteSourceMgStreamImpl.Rewind",
- __LINE__, __WFILE__, NULL, L"", NULL);
-}
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ByteSourceStreamImpl.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,104 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_BYTE_SOURCE_STREAM_IMPL_H_
-#define MG_BYTE_SOURCE_STREAM_IMPL_H_
-
-#if WANT_ACE
-/// INTERNAL_CLASS - NOT EXPOSED
-
-/// \cond INTERNAL
-class MgStream;
-/////////////////////////////////////////////////////////////////
-/// \brief
-/// ByteSourceSocketStreamImpl provides access to the bytes on a file source
-class ByteSourceMgStreamImpl : public ByteSourceImpl
-{
- DECLARE_CLASSNAME(ByteSourceMgStreamImpl)
-
-public:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Construct a ByteSourceMgStreamImpl object
- ///
- /// \param stream
- /// MgStream object
- ///
- ByteSourceMgStreamImpl(MgStream* stream);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destructor
- ///
- virtual ~ByteSourceMgStreamImpl();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Reads a buffer
- ///
- /// \param buffer
- /// A buffer receiving the data.
- /// \param length
- /// Maximum number of bytes to read
- ///
- /// \return
- /// Actual number of bytes put in the buffer. 0 means end of bytes
- ///
- INT32 Read(BYTE_ARRAY_OUT buffer, INT32 length);
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns the remaining length of the byte source. This length is
- /// adjusted for previous reads. If the returned length is zero
- /// then the underlying source may be a streaming format and the length
- /// is not known.
- ///
- /// \return
- /// Remaining length of the byte source
- ///
- INT64 GetLength();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Determines if the source is rewindable.
- ///
- /// \return
- /// true if the source is rewindable, false otherwise.
- ///
- bool IsRewindable();
-
- ////////////////////////////////////////////////////////////////
- /// \brief
- /// Rewinds to the start of the source. This implementation
- /// does not support rewind.
- ///
- /// \return
- /// Nothing
- ///
- /// \exception MgInvalidOperationException will be thrown since MgStream cannot be rewound
- ///
- void Rewind();
-
-protected:
- MgStream* m_stream;
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif
Deleted: sandbox/adsk/vik/Common/Foundation/System/ClassFactory.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ClassFactory.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ClassFactory.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,154 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-MgClassFactory::MgClassFactory()
-{
-}
-
-MgClassFactory* MgClassFactory::GetInstance()
-{
- static Ptr<MgClassFactory> classFactory;
- MG_TRY()
-
- ACE_TRACE ("MgClassFactory::GetInstance");
-
- if (classFactory == NULL)
- {
- // Perform Double-Checked Locking Optimization.
- ACE_MT (ACE_GUARD_RETURN (ACE_Recursive_Thread_Mutex, ace_mon, *ACE_Static_Object_Lock::instance (), 0));
- if (classFactory == NULL)
- {
- classFactory = new MgClassFactory();
- }
- }
-
- MG_RESOURCES_CATCH_AND_THROW(L"MgClassFactory.GetInstance")
-
- // To avoid overhead and maintain thread safety,
- // do not assign this returned static singleton to a Ptr object.
- return classFactory;
-}
-
-
-void MgClassFactory::Dispose()
-{
- delete this;
-}
-
-
-MgObject* MgClassFactory::CreateMgObject(int classId)
-{
- ClassCreatorFunc func = m_classCreators[classId];
- if (NULL == func)
- {
- throw new MgClassNotFoundException(L"MgClassFactory.CreateMgObject", __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- MgObject* obj = (*func)();
- return obj;
-}
-
-
-void MgClassFactory::Register(int classId, ClassCreatorFunc creator)
-{
- if (0 >= classId || NULL == creator)
- {
- throw new MgInvalidArgumentException(L"MgClassFactory.RegisterClass", __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_classCreators[classId] = creator;
-}
-
-
-
-static bool InitializeStaticData();
-
-static bool initStatic = InitializeStaticData();
-
-#define EXCEPTION_CLASS_CREATOR(className) \
- fact->Register(Foundation_Exception_##className, className::CreateObject);
-
-bool InitializeStaticData()
-{
- MgClassFactory* fact = MgClassFactory::GetInstance();
-
- //put in the map any class that can be serialized
- fact->Register(Foundation_Data_ByteReader, MgByteReader::CreateObject);
-
- fact->Register(Foundation_Data_DateTime, MgDateTime::CreateObject);
- fact->Register(Foundation_Collection_PropertyCollection, MgPropertyCollection::CreateObject);
- fact->Register(Foundation_Collection_StringCollection, MgStringCollection::CreateObject);
- fact->Register(Foundation_Collection_BatchPropertyCollection, MgBatchPropertyCollection::CreateObject);
- fact->Register(Foundation_Property_StringProperty,MgStringProperty::CreateObject);
- fact->Register(Foundation_Property_PropertyDefinition,MgPropertyDefinition::CreateObject);
-
- EXCEPTION_CLASS_CREATOR(MgArgumentOutOfRangeException)
- EXCEPTION_CLASS_CREATOR(MgClassNotFoundException)
- EXCEPTION_CLASS_CREATOR(MgConfigurationException)
- EXCEPTION_CLASS_CREATOR(MgConfigurationLoadFailedException)
- EXCEPTION_CLASS_CREATOR(MgConfigurationSaveFailedException)
- EXCEPTION_CLASS_CREATOR(MgDateTimeException)
- EXCEPTION_CLASS_CREATOR(MgDecryptionException)
- EXCEPTION_CLASS_CREATOR(MgDirectoryNotFoundException)
- EXCEPTION_CLASS_CREATOR(MgDivideByZeroException)
- EXCEPTION_CLASS_CREATOR(MgDomainException)
- EXCEPTION_CLASS_CREATOR(MgDuplicateDirectoryException)
- EXCEPTION_CLASS_CREATOR(MgDuplicateFileException)
- EXCEPTION_CLASS_CREATOR(MgDuplicateObjectException)
- EXCEPTION_CLASS_CREATOR(MgEncryptionException)
- EXCEPTION_CLASS_CREATOR(MgFileIoException)
- EXCEPTION_CLASS_CREATOR(MgFileNotFoundException)
- EXCEPTION_CLASS_CREATOR(MgIndexOutOfRangeException)
- EXCEPTION_CLASS_CREATOR(MgInvalidArgumentException)
- EXCEPTION_CLASS_CREATOR(MgInvalidCastException)
- EXCEPTION_CLASS_CREATOR(MgInvalidMimeTypeException)
- EXCEPTION_CLASS_CREATOR(MgInvalidOperationException)
- EXCEPTION_CLASS_CREATOR(MgInvalidPropertyTypeException)
- EXCEPTION_CLASS_CREATOR(MgInvalidStreamHeaderException)
- EXCEPTION_CLASS_CREATOR(MgIoException)
- EXCEPTION_CLASS_CREATOR(MgLengthException)
- EXCEPTION_CLASS_CREATOR(MgLogicException)
- EXCEPTION_CLASS_CREATOR(MgNotFiniteNumberException)
- EXCEPTION_CLASS_CREATOR(MgNotImplementedException)
- EXCEPTION_CLASS_CREATOR(MgNullArgumentException)
- EXCEPTION_CLASS_CREATOR(MgNullPropertyValueException)
- EXCEPTION_CLASS_CREATOR(MgNullReferenceException)
- EXCEPTION_CLASS_CREATOR(MgObjectNotFoundException)
- EXCEPTION_CLASS_CREATOR(MgOutOfMemoryException)
- EXCEPTION_CLASS_CREATOR(MgOutOfRangeException)
- EXCEPTION_CLASS_CREATOR(MgOverflowException)
- EXCEPTION_CLASS_CREATOR(MgPlatformNotSupportedException)
- EXCEPTION_CLASS_CREATOR(MgResourcesException)
- EXCEPTION_CLASS_CREATOR(MgResourcesLoadFailedException)
- EXCEPTION_CLASS_CREATOR(MgResourceTagNotFoundException)
- EXCEPTION_CLASS_CREATOR(MgRuntimeException)
- EXCEPTION_CLASS_CREATOR(MgStreamIoException)
- EXCEPTION_CLASS_CREATOR(MgTemporaryFileNotAvailableException)
- EXCEPTION_CLASS_CREATOR(MgUnclassifiedException)
- EXCEPTION_CLASS_CREATOR(MgUnderflowException)
- EXCEPTION_CLASS_CREATOR(MgXmlException)
- EXCEPTION_CLASS_CREATOR(MgXmlParserException)
-
- return true;
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/ClassFactory.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ClassFactory.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ClassFactory.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,85 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGCLASSFACTORY_H_
-#define MGCLASSFACTORY_H_
-
-#include <map>
-
-#if WANT_ACE
-
-/// Typedef for class creation functions
-typedef MgObject* (*ClassCreatorFunc)();
-
-
-/// \cond INTERNAL
-
-/// INTERNAL_CLASS
-/// \brief
-/// Class registration for Foundation derived applications
-class MG_FOUNDATION_API MgClassFactory : public MgDisposable
-{
- DECLARE_CLASSNAME(MgClassFactory)
-
-INTERNAL_API:
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns global object instance
- ///
- /// \return
- /// Class factory for application
- ///
- static MgClassFactory* GetInstance();
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Registers a class creator with the factory
- ///
- ///
- void Register(int classId, ClassCreatorFunc creator);
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Creates object
- ///
- /// \return
- /// Newly created object for requested classId
- ///
- MgObject* CreateMgObject(int classId);
-
-protected:
-
- virtual void Dispose();
-
-private:
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Object constructor
- ///
- MgClassFactory();
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Declaration of class Registry
- std::map<int, ClassCreatorFunc> m_classCreators;
-
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif
Deleted: sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,467 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-MgConfigurationHeap::MgConfigurationHeap()
-{
- m_rootSection = new MgConfigurationSection();
- m_sectionCollection = new MgConfigurationSectionCollection();
-}
-
-
-MgConfigurationHeap::~MgConfigurationHeap()
-{
-}
-
-
-bool MgConfigurationHeap::ImportConfig(CREFSTRING fileName)
-{
- if (fileName.empty())
- {
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(MgResources::BlankArgument);
-
- throw new MgInvalidArgumentException(L"MgConfigImpExp.ImportConfig",
- __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
- }
-
-#ifdef _WIN32
- FILE* inFile = _wfopen(fileName.c_str(), L"r,ccs=UTF-8");
-#else
- FILE* inFile = ACE_OS::fopen(MG_WCHAR_TO_TCHAR(fileName), ACE_TEXT("r"));
-#endif
- if (!inFile)
- {
- return false;
- }
-
- MG_TRY()
-
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
-
- Ptr<MgConfigurationSection> currentSection = SAFE_ADDREF((MgConfigurationSection*)m_rootSection);
-
- ACE_TCHAR buffer[4096];
- ACE_Configuration_Section_Key sectionKey = m_aceConfigurationHeap.root_section();
- while (ACE_OS::fgets(buffer, 4095, inFile))
- {
- wstring mbLine = Trim(MG_TCHAR_TO_WCHAR(buffer)); // remove extra spaces at beginning and end of line
-
- // Blank line
- if (mbLine.size() <= 0 || mbLine[0] == L'\0')
- {
- continue;
- }
-
- // Comment
- if (mbLine[0] == L'#' || mbLine[0] == L';')
- {
- currentSection->AddComment(mbLine);
- continue;
- }
-
- // New section is here
- if (mbLine[0] == L'[')
- {
- // Seperate out the section name
- size_t pos = mbLine.find(L']');
- if (pos == string::npos)
- {
- ACE_OS::fclose(inFile);
- return false;
- }
- mbLine.erase(pos,1);
- mbLine.erase(0,1);
-
- wstring sectionPath = Trim(mbLine);
-
- currentSection = AddSection(sectionPath, sectionKey);
- if (currentSection == NULL)
- {
- ACE_OS::fclose(inFile);
- return false;
- }
- continue;
- }
-
- // Must be a property if it gets to here
- size_t pos = mbLine.find(L'=');
- if (pos == string::npos)
- {
- // No equal sign, so something is wrong with file format
- ACE_OS::fclose(inFile);
- return false;
- }
-
- // Seperate out the property name and the value
- wstring propertyName = Trim(mbLine.substr(0, pos).c_str());
- wstring value = Trim(mbLine.substr(pos+1, (mbLine.size()-pos-1)).c_str());
- // Remove any quotes that may be present at ends of value
- if (value.size() > 0 && value[0] == L'\"' && value[value.length()-1] == L'\"')
- {
- value = value.substr(1,value.length()-2);
- }
-
- //currentSection->AddSectionInformation(MgUtil::MultiByteToWideChar(propertyName));
- SetStringValue(sectionKey, MG_WCHAR_TO_TCHAR(propertyName), MG_WCHAR_TO_TCHAR(value));
- }
-
- ACE_OS::fclose(inFile);
-
- MG_CATCH(L"MgConfigImpExp.ImportConfig")
- if (mgException != NULL)
- {
- ACE_OS::fclose(inFile);
- (*mgException).AddRef();
- mgException->Raise();
- }
-
- return true;
-}
-
-
-bool MgConfigurationHeap::ExportConfig(CREFSTRING fileName)
-{
- if (fileName.empty())
- {
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(MgResources::BlankArgument);
-
- throw new MgInvalidArgumentException(L"MgConfigImpExp.ImportConfig",
- __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
- }
-
- FILE* outFile = NULL;
-
- MG_TRY()
-
-#ifdef _WIN32
- outFile = _wfopen(fileName.c_str(), L"w,ccs=UTF-8");
-#else
- outFile = ACE_OS::fopen(MG_WCHAR_TO_TCHAR(fileName), ACE_TEXT("w"));
-#endif
- if (!outFile)
- {
- return false;
- }
-
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
-
- ExportSection(m_rootSection, outFile);
-
- Ptr<MgConfigurationSection> section;
- INT32 count = m_sectionCollection->GetCount();
- INT32 i;
- for (i = 0; i < count; i++)
- {
- section = m_sectionCollection->GetItem(i);
- if (!ExportSection(section, outFile))
- {
- ACE_OS::fclose(outFile);
- return false;
- }
- }
-
- ACE_OS::fclose(outFile);
-
- MG_CATCH(L"MgConfigurationHeap.ExportConfig")
-
- if (mgException != NULL)
- {
- if (outFile)
- {
- ACE_OS::fclose(outFile);
- }
- (*mgException).AddRef();
- mgException->Raise();
- }
-
- return true;
-}
-
-
-// This (private) method is NOT thread-safe - callers are responsible
-// for serializing access.
-bool MgConfigurationHeap::ExportSection(MgConfigurationSection* section, FILE* outFile)
-{
- wstring sectionPath;
- wstring line;
-
- sectionPath = section->GetSectionPath();
-
- ACE_Configuration_Section_Key key;
- if (sectionPath.length() > 0)
- {
- line = L"\n[" + sectionPath + L"]\n";
- ACE_OS::fputs(MG_WCHAR_TO_TCHAR(line), outFile);
-
- if (m_aceConfigurationHeap.open_section(m_aceConfigurationHeap.root_section(), MG_WCHAR_TO_TCHAR(sectionPath), 0, key) != 0)
- {
- return false;
- }
- }
- else
- {
- // section being exported is root section
- key = m_aceConfigurationHeap.root_section();
- }
-
- // Write out section Comments
- INT32 count = section->GetCommentCount();
- INT32 i;
- for (i = 0; i < count; i++)
- {
- line = section->GetComment(i);
- if (line[0] != L'#')
- {
- line = L"#" + line;
- }
- line += L"\n";
- ACE_OS::fputs(MG_WCHAR_TO_TCHAR(line), outFile);
- }
-
- i = 0;
- ACE_TString name;
- ACE_Configuration::VALUETYPE type;
- ACE_TCHAR int_value[32];
- ACE_TString string_value;
- while (!m_aceConfigurationHeap.enumerate_values(key, i, name, type))
- {
- line = MG_TCHAR_TO_WCHAR(name.c_str());
- line += L" = ";
- switch (type)
- {
- case ACE_Configuration::INTEGER:
- {
- u_int value;
- if (m_aceConfigurationHeap.get_integer_value(key, name.fast_rep(), value))
- {
- return false;
- }
- ACE_OS::sprintf(int_value, ACE_LIB_TEXT("%08x"), value);
- line += L"dword:";
- line += MG_TCHAR_TO_WCHAR(int_value);
- break;
- }
- case ACE_Configuration::STRING:
- {
- if (m_aceConfigurationHeap.get_string_value(key, name.fast_rep(), string_value))
- {
- return false;
- }
- line += MG_TCHAR_TO_WCHAR(string_value.c_str());
- break;
- }
-#ifdef _WIN32
- case ACE_Configuration::INVALID:
- break;
-#endif
- default:
- return false;
- }
- line += L"\n";
- if (ACE_OS::fputs(MG_WCHAR_TO_TCHAR(line), outFile) < 0)
- {
- return false;
- }
- i++;
- }
-
- return true;
-}
-
-
-wstring MgConfigurationHeap::Trim(const wstring& line)
-{
- wstring str = line;
-
- size_t pos = str.find_last_not_of(L" \t\r\n");
-
- // No non-whitespace characters were found
- if (pos == string::npos)
- {
- str = L"";
- }
- else
- {
- str.erase(pos+1);
- pos = str.find_first_not_of(L" \t\r\n");
- if (pos != string::npos || pos != (str.size()-1))
- {
- str.erase(0, pos);
- }
- }
-
- return str;
-}
-
-
-bool MgConfigurationHeap::OpenSection(CREFSTRING sectionPath, INT32 create, ACE_Configuration_Section_Key& key)
-{
- Ptr<MgConfigurationSection> section;
-
- MG_TRY()
-
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
-
- INT32 index = m_sectionCollection->IndexOf(sectionPath);
- if (create && index == -1)
- {
- section = AddSection(sectionPath, key);
- }
- else
- {
- if (m_aceConfigurationHeap.open_section(m_aceConfigurationHeap.root_section(), MG_WCHAR_TO_TCHAR(sectionPath), create, key) != 0)
- {
- return false;
- }
- section = m_sectionCollection->GetItem(index);
- }
-
- MG_CATCH_AND_THROW(L"MgConfigurationHeap.OpenSection");
-
- return (section != NULL);
-}
-
-
-// This (private) method is NOT thread-safe - callers are responsible
-// for serializing access.
-MgConfigurationSection* MgConfigurationHeap::AddSection(CREFSTRING sectionPath, ACE_Configuration_Section_Key& key)
-{
- Ptr<MgConfigurationSection> section;
-
- MG_TRY()
-
- if (m_aceConfigurationHeap.open_section(m_aceConfigurationHeap.root_section(), MG_WCHAR_TO_TCHAR(sectionPath), 1, key) != 0)
- {
- // Error retrieving section from ACE_Configuration_Heap object
- return NULL;
- }
-
- INT32 index = m_sectionCollection->IndexOf(sectionPath);
- if (index == -1)
- {
- section = new MgConfigurationSection(sectionPath);
- if (section == NULL)
- {
- throw new MgOutOfMemoryException(L"MgConfigurationHeap.AddSection", __LINE__, __WFILE__, NULL, L"", NULL);
- }
- m_sectionCollection->Add(section);
- }
- else
- {
- section = m_sectionCollection->GetItem(index);
- }
-
- MG_CATCH_AND_THROW(L"MgConfigurationHeap.AddSection");
-
- return SAFE_ADDREF((MgConfigurationSection*)section);
-}
-
-
-bool MgConfigurationHeap::RemoveSection(CREFSTRING sectionPath, int recursive)
-{
- bool result = true;
-
- MG_TRY()
-
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
-
- if (m_aceConfigurationHeap.remove_section(m_aceConfigurationHeap.root_section(), MG_WCHAR_TO_TCHAR(sectionPath), recursive) != 0)
- {
- result = false;
- }
-
- INT32 index = m_sectionCollection->IndexOf(sectionPath);
- if (index != -1)
- {
- m_sectionCollection->RemoveAt(index);
- }
-
- if (recursive)
- {
- Ptr<MgConfigurationSection> section;
- section = NULL;
-
- INT32 i;
- INT32 count = m_sectionCollection->GetCount();
- for (i = 0; i < count; i++)
- {
- section = m_sectionCollection->GetItem(i);
- // Remove any sections that have the path of sectionPath/subsection or sectionPath\subsection
- if ((section->GetSectionPath()).find(sectionPath+L"/") == 0 ||
- (section->GetSectionPath()).find(sectionPath+L"\\") == 0)
- {
- m_sectionCollection->RemoveAt(i);
- }
- }
- }
-
- MG_CATCH_AND_THROW(L"MgConfigurationHeap.RemoveSection");
-
- return true;
-}
-
-
-bool MgConfigurationHeap::Open(int default_map_size)
-{
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
- return (m_aceConfigurationHeap.open(default_map_size) == 0);
-}
-
-
-bool MgConfigurationHeap::EnumerateSections(const ACE_Configuration_Section_Key& key, int index, ACE_TString& name)
-{
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
- return (m_aceConfigurationHeap.enumerate_sections(key, index, name) == 0);
-}
-
-
-bool MgConfigurationHeap::EnumerateValues(const ACE_Configuration_Section_Key& key, int index, ACE_TString& name, ACE_Configuration::VALUETYPE& type)
-{
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
- return (m_aceConfigurationHeap.enumerate_values(key, index, name, type) == 0);
-}
-
-
-bool MgConfigurationHeap::SetStringValue(const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, const ACE_TString& value)
-{
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
- return (m_aceConfigurationHeap.set_string_value(key, name, value) == 0);
-}
-
-
-bool MgConfigurationHeap::GetStringValue(const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, ACE_TString& value)
-{
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
- return (m_aceConfigurationHeap.get_string_value(key, name, value) == 0);
-}
-
-
-bool MgConfigurationHeap::RemoveValue(const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name)
-{
- ACE_MT(ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, ace_mon, m_mutex, false));
- return (m_aceConfigurationHeap.remove_value(key, name) == 0);
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ConfigurationHeap.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,163 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_CONFIGURATION_HEAP_H_
-#define MG_CONFIGURATION_HEAP_H_
-
-#if WANT_ACE
-
-/// \cond INTERNAL
-class MgConfigurationHeap
-{
- DECLARE_CLASSNAME(MgConfigurationHeap)
-
-INTERNAL_API:
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Creates a new object, initializing the section list and root section
- ///
- /// \param sectionName
- /// Name of the section
- ///
- /// \return
- /// Returns nothing
- ///
- MgConfigurationHeap();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Destructs the object
- ///
- /// \return
- /// Returns nothing
- ///
- ~MgConfigurationHeap();
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Imports a configuration from a file
- ///
- /// \param filename
- /// File containing the configuration
- ///
- /// \return
- /// True if no errors occur, false otherwise
- ///
- bool ImportConfig(CREFSTRING filename);
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Exports a configuration to a file
- ///
- /// \param filename
- /// File to export the configuration to
- ///
- /// \return
- /// True if no Errors occur, false otherwise
- ///
- bool ExportConfig(CREFSTRING filename);
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Sets the section key to be that belonging to the section path.
- /// Creates a new section if it doesn't exist and create is not zero.
- ///
- /// \param sectionPath
- /// Name of the section to be retrieved
- /// \param create
- /// 1 to create the section if it doesn't exists, 0 otherwise
- /// \param key
- /// ACE_Configuration_Section_Key to be set based on the sectionPath
- ///
- /// \return
- /// True if no Errors occur, false otherwise
- ///
- bool OpenSection(CREFSTRING sectionPath, INT32 create, ACE_Configuration_Section_Key &key);
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Exports a configuration to a file
- ///
- /// \param filename
- /// File to export the configuration to
- ///
- /// \return
- /// True if no Errors occur, false otherwise
- ///
- bool RemoveSection(CREFSTRING sectionPath, int recursive = 0);
-
- /// Functions for ACE_Configuration_Heap
- bool Open(int default_map_size = ACE_DEFAULT_CONFIG_SECTION_SIZE);
- bool EnumerateSections(const ACE_Configuration_Section_Key& key, int index, ACE_TString& name);
- bool EnumerateValues(const ACE_Configuration_Section_Key& key, int index, ACE_TString& name, ACE_Configuration::VALUETYPE& type);
- bool SetStringValue(const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, const ACE_TString& value);
- bool GetStringValue(const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name, ACE_TString& value);
- bool RemoveValue(const ACE_Configuration_Section_Key& key, const ACE_TCHAR* name);
-
-private:
- Ptr<MgConfigurationSection> m_rootSection;
- Ptr<MgConfigurationSectionCollection> m_sectionCollection;
-
- ACE_Configuration_Heap m_aceConfigurationHeap;
- ACE_Recursive_Thread_Mutex m_mutex;
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Adds a new section to the configuration object
- ///
- /// \param sectionPath
- /// Name of the section to be retrieved
- /// \param key
- /// ACE_Configuration_Section_Key to be set based on the sectionPath
- ///
- /// \return
- /// The MgConfigurationSection object that was created
- ///
- MgConfigurationSection* AddSection(CREFSTRING sectionPath, ACE_Configuration_Section_Key& key);
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the section name, comments and parameters to the specified file
- ///
- /// \param section
- /// The MgConfigurationSection object to be written out to file
- /// \param outFile
- /// File stream to export the section to
- ///
- /// \return
- /// True if no Errors occur, false otherwise
- ///
- bool ExportSection(MgConfigurationSection* section, FILE* outFile);
-
- ///////////////////////////////////////////////////////////////////////////
- /// \brief
- /// Removes any whitespace ( ntr) from the beginning and end of given string
- ///
- /// \param line
- /// The string to remove white space from
- ///
- /// \return
- /// The string after the white space has been removed
- ///
- wstring Trim(const wstring& line);
-};
-/// \endcond
-
-
-#endif //WANT_ACE
-
-#endif // MG_CONFIGURATION_HEAP_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,129 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-
-MgConfigurationSectionCollection::MgConfigurationSectionCollection()
-{
- m_collection = new MgDisposableCollection();
-}
-
-
-MgConfigurationSectionCollection::~MgConfigurationSectionCollection()
-{
-}
-
-
-void MgConfigurationSectionCollection::Dispose()
-{
- delete this;
-}
-
-
-void MgConfigurationSectionCollection::Add(MgConfigurationSection* value)
-{
- m_collection->Add(value);
-}
-
-
-void MgConfigurationSectionCollection::Insert(INT32 index, MgConfigurationSection* value)
-{
- m_collection->Insert(index, value);
-}
-
-
-bool MgConfigurationSectionCollection::Remove(MgConfigurationSection* value)
-{
- bool removed = true;
- try
- {
- m_collection->Remove(value);
- }
- catch (MgException* e)
- {
- e->Release();
- removed = false;
- }
- return removed;
-}
-
-
-void MgConfigurationSectionCollection::SetItem(INT32 index, MgConfigurationSection* value)
-{
- m_collection->SetItem(index, value);
-}
-
-
-MgConfigurationSection* MgConfigurationSectionCollection::GetItem(INT32 index) const
-{
- return (MgConfigurationSection*)m_collection->GetItem(index);
-}
-
-
-INT32 MgConfigurationSectionCollection::GetCount() const
-{
- return m_collection->GetCount();
-}
-
-
-void MgConfigurationSectionCollection::Clear()
-{
- m_collection->Clear();
-}
-
-
-void MgConfigurationSectionCollection::RemoveAt(INT32 index)
-{
- m_collection->RemoveAt(index);
-}
-
-
-bool MgConfigurationSectionCollection::Contains(const MgConfigurationSection* value)
-{
- return m_collection->Contains(value);
-}
-
-
-INT32 MgConfigurationSectionCollection::IndexOf(CREFSTRING sectionPath) const
-{
- MG_TRY()
-
- Ptr<MgConfigurationSection> section;
- INT32 numSections = m_collection->GetCount();
-
- INT32 i;
- for (i = 0; i < numSections; i++)
- {
- section = this->GetItem(i);
- if (sectionPath == section->GetSectionPath())
- {
- return i;
- }
- }
-
- MG_CATCH_AND_THROW(L"MgConfigurationSectionCollection.IndexOf")
-
- return -1;
-}
-
-
-INT32 MgConfigurationSectionCollection::IndexOf(const MgConfigurationSection* value) const
-{
- return m_collection->IndexOf(value);
-}
Deleted: sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ConfigurationSectionCollection.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,197 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef _MG_CONFIGURATION_SECTION_COLLECTION_H
-#define _MG_CONFIGURATION_SECTION_COLLECTION_H
-
-class MgConfigurationSection;
-
-/// \cond INTERNAL
-class MgConfigurationSectionCollection : public MgDisposable
-{
- DECLARE_CLASSNAME(MgConfigurationSectionCollection)
-
-INTERNAL_API:
- //////////////////////////////////////////////////////////
- /// \brief
- /// Constructs an empty collection of Configuration section objects.
- ///
- MgConfigurationSectionCollection();
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Destructs the collection and the object contained in it.
- ///
- ~MgConfigurationSectionCollection();
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Adds the specified item to the end of the collection.
- ///
- /// \param value
- /// Input value
- ///
- /// \return
- /// Returns nothing
- ///
- /// \exception MgDuplicateObjectException if it is duplicate.
- ///
- void Add(MgConfigurationSection* value);
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Inserts the specified item at the specified index within the collection.
- /// Items following the insertion point are moved down to accommodate the new item.
- ///
- /// \param index
- /// Input index
- /// \param value
- /// Input value
- ///
- /// \return
- /// Returns nothing.
- ///
- /// \exception MgIndexOutOfRangeException if index is out of range.
- /// \exception MgDuplicateObjectException if it is duplicate.
- ///
- void Insert(INT32 index, MgConfigurationSection* value);
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Removes the specified item from the collection.
- ///
- /// \param value
- /// Input value
- ///
- /// \return
- /// Returns true if successful.
- ///
- bool Remove(MgConfigurationSection* value);
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Sets the item in the collection at the specified index to the specified value.
- ///
- /// \param index
- /// Input index
- /// \param value
- /// Input value
- ///
- /// \return
- /// Returns nothing.
- ///
- /// \exception MgIndexOutOfRangeException if index is out of range.
- /// \exception MgDuplicateObjectException if it is duplicate.
- ///
- void SetItem(INT32 index, MgConfigurationSection* value);
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Gets the item in the collection at the specified index.
- ///
- /// \param index
- /// Input index
- ///
- /// \return
- /// Returns the item in the collection at the specified index
- ///
- /// \exception MgIndexOutOfRangeException if the index is out of range.
- ///
- MgConfigurationSection* GetItem(INT32 index) const;
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Gets the number of items in the collection.
- ///
- /// \return
- /// Returns the number of items in the collection.
- ///
- INT32 GetCount() const;
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Removes all items from the collection.
- ///
- /// \return
- /// Returns nothing.
- ///
- void Clear();
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Removes the specified item from the collection.
- ///
- /// \param index
- /// Input index
- ///
- /// \return
- /// Returns nothing
- ///
- /// \exception MgIndexOutOfRangeException
- ///
- void RemoveAt(INT32 index);
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Returns true if the collection contains the specified item, false otherwise.
- ///
- /// \param value
- /// Input value
- ///
- /// \return
- /// Returns true if the collection contains the specified item, false otherwise.
- ///
- bool Contains(const MgConfigurationSection* value);
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Returns the index of the configuration section object with the specified path or -1 if the item does not exist.
- ///
- /// \param value
- /// Section Path
- ///
- /// \return
- /// Returns the index of the configuration section object with the specified path or -1 if the item does not exist.
- ///
- INT32 IndexOf(CREFSTRING sectionPath) const;
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Returns the index of the specified item in the collection or -1 if the item does not exist.
- ///
- /// \param value
- /// Input value
- ///
- /// \return
- /// Returns the index of the specified item in the collection or -1 if the item does not exist.
- ///
- INT32 IndexOf(const MgConfigurationSection* value) const;
-
-protected:
-
- //////////////////////////////////////////////////////////
- /// \brief
- /// Disposes the object.
- ///
- virtual void Dispose();
-
-private:
- Ptr<MgDisposableCollection> m_collection;
-};
-/// \endcond
-
-#endif // _MG_CONFIGURATION_SECTION_COLLECTION_H
Deleted: sandbox/adsk/vik/Common/Foundation/System/ControlPacket.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ControlPacket.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ControlPacket.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,39 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGCONTROLPACKET_H_MG
-#define MGCONTROLPACKET_H_MG
-
-#include "BasicPacket.h"
-
-/// \cond INTERNAL
-// Control Packet Wrapper Structure
-struct MgControlPacket : public MgBasicPacket
-{
- MgControlPacket()
- :
- m_PacketVersion(0),
- m_ControlID(0)
- {
- }
-
- UINT32 m_PacketVersion;
- UINT32 m_ControlID;
-};
-/// \endcond
-
-#endif // MGCONTROLPACKET_H_MG
Modified: sandbox/adsk/vik/Common/Foundation/System/Disposable.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/Disposable.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/Disposable.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -63,7 +63,7 @@
ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgDisposable::Addref(). Class Name: %W. Called with Reference Count = 0.\n"), GetClassName().c_str()));
#endif
- throw new MgException(L"MgDisposable.AddRef", __LINE__, __WFILE__, NULL, L"Logic", NULL);
+ throw new MgException(L"Logic");
}
return ++m_refCount;
@@ -94,7 +94,7 @@
ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgDisposable::Release(). Class Name: %W. Called with Reference Count <= 0.\n"), GetClassName().c_str()));
#endif
- throw new MgException(L"MgDisposable.Release", __LINE__, __WFILE__, NULL, L"Logic", NULL);
+ throw new MgException(L"Logic");
}
--m_refCount;
Modified: sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -79,8 +79,7 @@
MgDisposable* MgDisposableCollection::GetItem(INT32 index) const
{
if (index >= m_size || index < 0)
- throw new MgException(L"GetItem",__LINE__, __WFILE__, NULL, L"IndexOutOfRange", NULL);
- // EXC::Create(Exception::NLSGetMessage(_NLSID(_5_INDEXOUTOFBOUNDS)));
+ throw new MgException(L"IndexOutOfRange");
return SAFE_ADDREF(m_list[index]);
}
@@ -102,7 +101,7 @@
m_list[index] = SAFE_ADDREF(value);
}
else
- throw new MgException(L"SetItem", __LINE__, __WFILE__, NULL, L"IndexOutOfRange", NULL);
+ throw new MgException(L"IndexOutOfRange");
// EXC::Create(GisException::NLSGetMessage(GIS_NLSID(GIS_5_INDEXOUTOFBOUNDS)));
}
@@ -148,7 +147,7 @@
m_size++;
}
else
- throw new MgException(L"Insert", __LINE__, __WFILE__, NULL, L"IndexOutOfRange", NULL);
+ throw new MgException(L"IndexOutOfRange");
// EXC::Create(GisException::NLSGetMessage(GIS_NLSID(GIS_5_INDEXOUTOFBOUNDS)));
}
@@ -222,7 +221,7 @@
m_list[--m_size] = NULL;
}
else
- throw new MgException(L"RemoveAt", __LINE__, __WFILE__, NULL, L"IndexOutOfRange", NULL);
+ throw new MgException(L"IndexOutOfRange");
}
@@ -272,7 +271,7 @@
return index;
}
-
+#if WANT_ACE
//////////////////////////////////////////////////////////////////
/// <summary>
/// Creates an XML document representing the collection.
@@ -282,7 +281,7 @@
/// </returns>
MgByteReader* MgDisposableCollection::ToXml()
{
- throw new MgException(L"MgDisposableCollection.ToXml", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
return NULL;
}
@@ -296,7 +295,7 @@
/// <returns>Returns nothing.</returns>
void MgDisposableCollection::Serialize(MgStream* stream)
{
- throw new MgException(L"MgDisposableCollection.Serialize", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
}
@@ -308,10 +307,10 @@
/// <returns>Returns nothing.</returns>
void MgDisposableCollection::Deserialize(MgStream* stream)
{
- throw new MgException(L"MgDisposableCollection.Deserialize", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
}
+#endif
-
/////////////////////////////////////////////////////////////////
/// <summary>
/// Disposes the object.
Modified: sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/DisposableCollection.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -179,6 +179,7 @@
///
virtual INT32 IndexOf(const MgDisposable* value) const;
+#if WANT_ACE
//////////////////////////////////////////////////////////
/// \brief
/// Creates an XML document representing the collection.
@@ -207,6 +208,7 @@
/// Stream
///
virtual void Deserialize(MgStream* stream);
+#endif
EXTERNAL_API:
Modified: sandbox/adsk/vik/Common/Foundation/System/FileUtil.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/FileUtil.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/FileUtil.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -71,38 +71,17 @@
{
if (fileName.empty())
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(MgResources::BlankArgument);
-
- throw new MgException(
- L"MgFileUtil.ValidateFileName",
- __LINE__, __WFILE__, &arguments, L"MgStringEmpty", NULL);
+ throw new MgException(L"MgStringEmpty");
}
if (STRING::npos != fileName.find_first_of(sm_reservedCharacters))
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(fileName);
-
- MgStringCollection whyArguments;
- whyArguments.Add(sm_reservedCharacters);
-
- throw new MgException(
- L"MgFileUtil.ValidateFileName",
- __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
+ throw new MgException(L"MgStringContainsReservedCharacters: " + fileName);
}
if (L'.' == fileName[0] || L'.' == fileName[fileName.length() - 1])
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(fileName);
-
- throw new MgException(
- L"MgFileUtil.ValidateFileName",
- __LINE__, __WFILE__, &arguments, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument: " + fileName);
}
}
@@ -148,8 +127,7 @@
{
if (pathname.empty() || extension.empty())
{
- throw new MgException(L"MgFileUtil.EndsWithExtension",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
bool result = false;
@@ -215,8 +193,7 @@
if (pathname.empty())
{
- throw new MgException(L"MgFileUtil.GetFileStatus",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
STRING path = pathname;
@@ -238,11 +215,7 @@
if (!success && strict)
{
- MgStringCollection arguments;
- arguments.Add(pathname);
-
- throw new MgException(L"MgFileUtil.GetFileStatus",
- __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + pathname);
}
return success;
@@ -387,11 +360,7 @@
{
if (strict)
{
- MgStringCollection arguments;
- arguments.Add(path);
-
- throw new MgException(L"MgFileUtil.CreateDirectory",
- __LINE__, __WFILE__, &arguments, L"DuplicateDirectory", NULL);
+ throw new MgException(L"DuplicateDirectory: " + path);
}
return;
@@ -455,8 +424,7 @@
case ENOENT:
case EACCES:
default:
- throw new MgException(L"MgFileUtil.MkDir",
- __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo");
break;
}
}
@@ -827,11 +795,7 @@
if (getcwd(buffer, PATH_MAX) == NULL)
#endif
{
- MgStringCollection arguments;
- arguments.Add(path);
-
- throw new MgException(L"MgFileUtil.ChangeDirectory",
- __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + path);
}
#ifdef _WIN32
@@ -840,11 +804,7 @@
if (chdir(MG_WCHAR_TO_TCHAR(path)) != 0)
#endif
{
- MgStringCollection arguments;
- arguments.Add(path);
-
- throw new MgException(L"MgFileUtil.ChangeDirectory",
- __LINE__, __WFILE__, &arguments, L"DirectoryNotFound", NULL);
+ throw new MgException(L"DirectoryNotFound: " + path);
}
currDir = MG_TCHAR_TO_WCHAR(buffer);
@@ -895,8 +855,7 @@
MgStringCollection arguments;
arguments.Add(pathname);
- throw new MgException(L"MgFileUtil.DeleteFile",
- __LINE__, __WFILE__, &arguments, L"FileNotFound", NULL);
+ throw new MgException(L"FileNotFound: " + pathname);
}
return;
@@ -911,16 +870,13 @@
if (0 != errCode)
{
errCode = errno; // This is not thread safe - requires guard
- MgStringCollection arguments;
- arguments.Add(pathname);
switch (errCode)
{
case ENOENT: // PathnameExists is more reliable. It gets called above, so this error should not be detected.
case EACCES:
default:
- throw new MgException(L"MgFileUtil.DeleteFile",
- __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + pathname);
break;
}
}
@@ -945,8 +901,7 @@
{
if (path.empty() || oldFileName.empty() || newFileName.empty())
{
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
STRING oldPathname = path;
@@ -977,17 +932,12 @@
{
if (oldPathname.empty() || newPathname.empty())
{
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
if (_wcsicmp(oldPathname.c_str(), newPathname.c_str()) == 0)
{
- MgStringCollection arguments;
- arguments.Add(newPathname);
-
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, &arguments, L"DuplicateFile", NULL);
+ throw new MgException(L"DuplicateFile: " + newPathname);
}
MgLock lock(sm_mutex);
@@ -998,45 +948,28 @@
}
else if (PathnameExists(newPathname))
{
- MgStringCollection arguments;
- arguments.Add(newPathname);
-
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, &arguments, L"DuplicateFile", NULL);
+ throw new MgException(L"DuplicateFile: " + newPathname);
}
#ifdef _WIN32
int errCode = ::_wrename(oldPathname.c_str(), newPathname.c_str());
#else
- int errCode = ACE_OS::rename(MG_WCHAR_TO_TCHAR(oldPathname), MG_WCHAR_TO_TCHAR(newPathname));
+ int errCode = ::rename(MG_WCHAR_TO_TCHAR(oldPathname), MG_WCHAR_TO_TCHAR(newPathname));
#endif
if (0 != errCode)
{
errCode = errno; // This is not thread safe - requires guard
- MgStringCollection arguments;
switch (errCode)
{
case ENOENT: // File or path specified by oldname not found.
- arguments.Add(oldPathname);
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, &arguments, L"FileNotFound", NULL);
+ throw new MgException(L"FileNotFound: " + oldPathname);
break;
case EINVAL: // Name contains invalid characters.
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(oldPathname);
- arguments.Add(L"2");
- arguments.Add(newPathname);
-
- MgStringCollection whyArguments;
- whyArguments.Add(L"");
-
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
+ throw new MgException(L"MgStringContainsReservedCharacters: " + newPathname + L" or " + oldPathname);
}
break;
@@ -1045,9 +978,7 @@
// or oldname is a directory and newname specifies a
// different path.
default:
- arguments.Add(newPathname);
- throw new MgException(L"MgFileUtil.RenameFile",
- __LINE__, __WFILE__, &arguments, L"FileIo", NULL);
+ throw new MgException(L"FileIo: " + newPathname);
break;
}
}
@@ -1109,8 +1040,7 @@
if (0 == tempFileName)
{
- throw new MgException(
- L"MgFileUtil.GenerateTempFileName", __LINE__, __WFILE__, NULL, L"TemporaryFileNotAvailable", NULL);
+ throw new MgException(L"TemporaryFileNotAvailable");
}
string tempStr = tempFileName;
@@ -1202,8 +1132,7 @@
if (pathname.empty())
{
- throw new MgException(L"MgFileUtil.IsFileInUse",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgLock lock(sm_mutex);
@@ -1213,7 +1142,7 @@
#ifdef _WIN32
file = _wfsopen(pathname.c_str(), L"r+", _SH_DENYRW);
#else
- file = ACE_OS::fopen(MG_WCHAR_TO_TCHAR(pathname), ACE_TEXT("r+"));
+ file = ::fopen(MG_WCHAR_TO_TCHAR(pathname), ACE_TEXT("r+"));
#endif
if (file)
Modified: sandbox/adsk/vik/Common/Foundation/System/GuardDisposable.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/GuardDisposable.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/GuardDisposable.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -34,7 +34,7 @@
#ifdef _DEBUG
ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgGuardDisposable::Addref(). Class Name: %W. Called with Reference Count = 0.\n"), GetClassName().c_str()));
#endif
- throw new MgException(L"MgGuardDisposable.AddRef", __LINE__, __WFILE__, NULL, L"Logic", NULL);
+ throw new MgException(L"Logic");
}
#if defined (__GNUC__)
@@ -57,7 +57,7 @@
#ifdef _DEBUG
ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%t) ************ Error in MgGuardDisposable::Release(). Class Name: %W. Called with Reference Count <= 0.\n"), GetClassName().c_str()));
#endif
- throw new MgException(L"MgGuardDisposable.Release", __LINE__, __WFILE__, NULL, L"Logic", NULL);
+ throw new MgException(L"Logic");
}
#if defined (__GNUC__)
Deleted: sandbox/adsk/vik/Common/Foundation/System/OperationPacket.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/OperationPacket.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/OperationPacket.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,48 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGOPERATIONPACKET_H_MG
-#define MGOPERATIONPACKET_H_MG
-
-#include "BasicPacket.h"
-class MgUserInformation;
-
-/// \cond INTERNAL
-// Operation Packet Wrapper Structure
-struct MgOperationPacket : public MgBasicPacket
-{
- MgOperationPacket()
- :
- m_PacketVersion(0),
- m_ServiceID(0),
- m_OperationID(0),
- m_OperationVersion(0),
- m_NumArguments(0),
- m_UserInfo(NULL)
- {
- }
-
- UINT32 m_PacketVersion;
- UINT32 m_ServiceID;
- UINT32 m_OperationID;
- UINT32 m_OperationVersion;
- UINT32 m_NumArguments;
- MgUserInformation* m_UserInfo;
-};
-/// \endcond
-
-#endif // MGOPERATIONPACKET_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/OperationResponsePacket.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/OperationResponsePacket.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/OperationResponsePacket.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,41 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGOPERATIONRESPONSEPACKET_H_MG
-#define MGOPERATIONRESPONSEPACKET_H_MG
-
-#include "BasicPacket.h"
-
-/// \cond INTERNAL
-// Operation Response Packet Wrapper Structure
-struct MgOperationResponsePacket : public MgBasicPacket
-{
- MgOperationResponsePacket()
- :
- m_PacketVersion(0),
- m_ECode(0),
- m_NumReturnValues(0)
- {
- }
-
- UINT32 m_PacketVersion;
- UINT32 m_ECode;
- UINT32 m_NumReturnValues;
-};
-/// \endcond
-
-#endif // MGOPERATIONRESPONSEPACKET_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/PacketParser.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/PacketParser.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/PacketParser.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,124 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-//-------------------------------------------------------------------------
-// Constructors and Destructors
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// The default constructor for a MgPacketParser object. However, since
-// this method is protected and this class is merely a wrapper for various
-// static methods, this constructor should never be called.
-// </summary>
-MgPacketParser::MgPacketParser( void )
-{
-};
-
-//-------------------------------------------------------------------------
-// Methods
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This static method reads the packet header from the given input data
-// stream. It does not consume any information from the stream.
-// </summary>
-//
-// <param name="pData">
-// A pointer the the MgStreamData object that encapsulates the incoming and
-// outgoing stream information.
-// </param>
-//
-// <returns>
-// The PacketHeader enumeration member that has been read from the
-// incoming data stream.
-// </returns>
-MgPacketParser::MgPacketHeader MgPacketParser::GetPacketHeader( MgStreamData* pData )
-{
- ACE_ASSERT( pData );
-
- MgPacketParser::MgPacketHeader ret = MgPacketParser::mphUnknown;
-
- if ( pData )
- {
- MgStreamHelper* pHelper = pData->GetStreamHelper();
-
- UINT32 header = 0;
-
- MgStreamHelper::MgStreamStatus stat = pHelper->GetUINT32( header, true, true );
-
- if ( MgStreamHelper::mssDone == stat )
- {
- ret = (MgPacketParser::MgPacketHeader) header;
- };
- };
-
- return ret;
-};
-
-
-bool MgPacketParser::GetControlPacket( MgStreamData* pData, MgControlPacket* pPacket )
-{
- ACE_ASSERT( pData );
-
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssError;
-
- if ( pData )
- {
- MgStreamHelper* pHelper = pData->GetStreamHelper();
-
- UINT64 dataread = pData->GetDataRead();
- UINT32 buffer = 0;
-
- // read packet header
- stat = pHelper->GetUINT32( buffer, true, false );
- if ( MgStreamHelper::mssDone == stat )
- {
- dataread += sizeof( buffer );
- pPacket->m_PacketHeader = buffer;
- }
-
- // read version
- stat = pHelper->GetUINT32( buffer, true, false );
- if ( MgStreamHelper::mssDone == stat )
- {
- dataread += sizeof( buffer );
- pPacket->m_PacketVersion = buffer;
- }
-
- // read control id
- stat = pHelper->GetUINT32( buffer, true, false );
- if ( MgStreamHelper::mssDone == stat )
- {
- dataread += sizeof( buffer );
- pPacket->m_ControlID = buffer;
- }
-
- // update read totals
- pData->SetDataRead( dataread );
- }
-
- return ( stat != MgStreamHelper::mssDone ) ? false : true;
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/PacketParser.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/PacketParser.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/PacketParser.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,122 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGPACKETPARSER_H_MG
-#define MGPACKETPARSER_H_MG
-
-#if WANT_ACE
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////
-// The PacketParser class wraps static methods that allow parsing of
-// packet structures and other information.
-class MG_FOUNDATION_API MgPacketParser
-{
- DECLARE_CLASSNAME(MgPacketParser)
-
- ///////////////////////////////////////////////////////////////////////
- /// Constructor
- protected :
- MgPacketParser( void );
-
- ///////////////////////////////////////////////////////////////////////
- /// Enumerations
- public :
-
- enum MgPacketHeader
- {
- mphUnknown = 0x1111FF01,
- mphOperation = 0x1111FF02,
- mphOperationResponse = 0x1111FF03,
- mphArgumentSimple = 0x1111FF04,
- mphArgumentCollection = 0x1111FF05,
- mphArgumentBinaryStream = 0x1111FF06,
- mphControl = 0x1111FF07,
- mphError = 0x1111FF08,
- mphEND = 0x1111FF09
- };
-
- enum MgServiceID
- {
- msiUnknown = 0x1111FE01,
- msiDrawing = 0x1111FE02,
- msiFeature = 0x1111FE03,
- msiMapping = 0x1111FE04,
- msiRendering = 0x1111FE05,
- msiResource = 0x1111FE06,
- msiServerAdmin = 0x1111FE07,
- msiSite = 0x1111FE08,
- msiTile = 0x1111FE09,
- msiKml = 0x1111FE0A,
- msiProfiling = 0x1111FE0B,
- msiEND = 0x1111FE0C
-
- };
-
- enum MgECode
- {
- mecSuccess = 0x1111FD01,
- mecSuccessWithWarning = 0x1111FD02,
- mecFailure = 0x1111FD03
- };
-
- enum MgArgumentType
- {
- matUnknown = 0x1111FC01,
- matINT8 = 0x1111FC02,
- matUINT8 = 0x1111FC03,
- matINT16 = 0x1111FC04,
- matUINT16 = 0x1111FC05,
- matINT32 = 0x1111FC06,
- matUINT32 = 0x1111FC07,
- matINT64 = 0x1111FC08,
- matUINT64 = 0x1111FC09,
- matFloat = 0x1111FC0A,
- matDouble = 0x1111FC0B,
- matString = 0x1111FC0C,
- matStream = 0x1111FC0D,
- matClassId = 0x1111FC0E,
- matEND = 0x1111FC0F
- };
-
- enum MgControlID
- {
- mciUnknown = 0x1111FB01,
- mciUserStop = 0x1111FB02,
- mciServerStop = 0x1111FB03,
- mciPause = 0x1111FB04,
- mciContinue = 0x1111FB05,
- mciClose = 0x1111FB06
- };
-
- enum MgStreamContentType
- {
- msctUnknown = 0x1111FA00
- };
-
- ///////////////////////////////////////////////////////////////////////
- /// Static Methods
- public :
- static MgPacketHeader GetPacketHeader( MgStreamData* pData );
-
- static bool GetControlPacket( MgStreamData* pData, MgControlPacket* pPacket );
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MGPACKETPARSER_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/PacketStructure.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/PacketStructure.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/PacketStructure.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,30 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGPACKETSTRUCTURE_H_MG
-#define MGPACKETSTRUCTURE_H_MG
-
-// all the packet wrapper structures
-#include "ArgumentPacket.h"
-#include "BasicPacket.h"
-#include "BinaryStreamArgumentPacket.h"
-#include "CollectionPacket.h"
-#include "ControlPacket.h"
-#include "OperationPacket.h"
-#include "OperationResponsePacket.h"
-
-#endif // MGPACKETSTRUCTURE_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,23 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-MgServerConnectionBase::~MgServerConnectionBase()
-{
-}
Deleted: sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/ServerConnectionBase.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,49 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_SERVER_CONNECTION_BASE_H
-#define MG_SERVER_CONNECTION_BASE_H
-
-/// \cond INTERNAL
-//////////////////////////////////////////////////////////////////
-/// \brief
-/// Represents a connection to a MapGuide server
-/// INTERNAL_ONLY:
-class MG_FOUNDATION_API MgServerConnectionBase : public MgGuardDisposable
-{
- INTERNAL_API:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Internal method used for getting stream helper
- /// which will then be used in serialize/deserialize
- ///
- /// \return
- /// MgStreamHelper which has method to write or read data
- /// over the wire
- ///
- virtual MgStream* GetStream() = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destructor. This will clean up the connection.
- ///
- virtual ~MgServerConnectionBase();
-};
-/// \endcond
-
-#endif
Deleted: sandbox/adsk/vik/Common/Foundation/System/Stream.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/Stream.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/Stream.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,91 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-/////////////////////////////////////////////////////////////////
-///<summary>
-/// Default Constructor
-///</summary>
-MgStream::MgStream() : MgStreamReader(NULL), MgStreamWriter(NULL)
-{}
-
-/////////////////////////////////////////////////////////////////
-///<summary>
-/// Constructors
-///</summary>
-///<param name="streamHelper">
-/// Stream helper object holding ACE_SOCK_STREAM
-///</param>
-MgStream::MgStream( MgStreamHelper* streamHelper ) : MgStreamReader(streamHelper), MgStreamWriter(streamHelper)
-{
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Destructor
-///</summary>
-MgStream::~MgStream()
-{
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Gets the class id
-///</summary>
-///<returns>
-///class id
-///</returns>
- INT32 MgStream::GetClassId()
-{
- return m_cls_id;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Self destructing method
-///</summary>
- void MgStream::Dispose()
-{
- delete this;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Returns the stream helper contained by this stream
-///</summary>
-///
-MgStreamHelper* MgStream::GetStreamHelper()
-{
- return MgStreamReader::GetStreamHelper();
-}
-
-//////////////////////////////////////////////////////////////////
-/// \brief
-/// Sets the stream helper for this stream
-///
-///
-void MgStream::SetStreamHelper(MgStreamHelper* helper)
-{
- MgStreamWriter::m_sHelper = SAFE_ADDREF(helper);
- MgStreamReader::m_sHelper = SAFE_ADDREF(helper);
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/Stream.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/Stream.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/Stream.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,99 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGSTREAM_H_
-#define MGSTREAM_H_
-
-#if WANT_ACE
-
-class MgByteReader;
-class MgStringCollection;
-
-class MgStream;
-template class MG_FOUNDATION_API Ptr<MgStream>;
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////
-// The MgStream class provides an interface to read and write data via TCP/IP
-class MG_FOUNDATION_API MgStream : public MgDisposable, public MgStreamReader, public MgStreamWriter
-{
- DECLARE_CLASSNAME(MgStream)
-
-INTERNAL_API:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Default Constructor
- ///
- ///
- MgStream();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Constructors
- ///
- /// \param streamHelper
- /// Stream helper object holding ACE_SOCK_STREAM
- ///
- MgStream( MgStreamHelper* streamHelper );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destructor
- ///
- virtual ~MgStream();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns the stream helper contained by this stream
- ///
- ///
- MgStreamHelper* GetStreamHelper();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Sets the stream helper for this stream
- ///
- ///
- void SetStreamHelper(MgStreamHelper* helper);
-
-protected:
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the class id
- ///
- /// \return
- /// class id
- ///
- INT32 GetClassId();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Self destructing method
- ///
- virtual void Dispose();
-
-CLASS_ID:
-
- static const INT32 m_cls_id = Foundation_Data_Stream;
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MGSTREAM_H
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamData.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamData.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamData.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,204 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-#include "StreamData.h"
-
-#if WANT_ACE
-
-//-------------------------------------------------------------------------
-// Constructors/Destructors
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Constructs a MgStreamData object with the given parameters/
-// </summary>
-//
-// <param name = "pHandler">
-// The ClientHandler object that is handling this stream.
-// </param>
-//
-// <param name = "handle">
-// The ACE_HANDLE underlying the stream.
-// </param>
-//
-// <param name = "pStreamHelper">
-// The MgStreamHelper object that handles data I/O for this stream.
-// </param>
-MgStreamData::MgStreamData( ACE_HANDLE handle, MgStreamHelper* pStreamHelper ) :
- m_Handle( handle ),
- m_pStreamHelper( SAFE_ADDREF(pStreamHelper) ),
- m_Version( 0 ),
- m_DataSize( 0 ),
- m_DataRead( 0 ),
- m_bError( false )
-{
- ACE_ASSERT( handle != 0 );
- ACE_ASSERT( pStreamHelper != NULL );
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Constructs a new MgStreamData object with the given MgStreamData object
-// </summary>
-//
-// <param name = "copy">
-// The MgStreamData object to copy for the new object.
-// </param>
-MgStreamData::MgStreamData( MgStreamData © ) :
- m_Handle( copy.m_Handle ),
- m_pStreamHelper( copy.m_pStreamHelper.Detach() ),
- m_Version( copy.m_Version ),
- m_DataSize( copy.m_DataSize ),
- m_DataRead( copy.m_DataRead ),
- m_bError( copy.m_bError )
-{
- ACE_ASSERT( m_Handle != 0 );
- ACE_ASSERT( NULL != m_pStreamHelper.p );
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// The destructor for the MgStreamData object.
-// </summary>
-MgStreamData::~MgStreamData()
-{
-};
-
-//-------------------------------------------------------------------------
-// Properties
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Gets the ACE_HANDLE associated with this MgStreamData object.
-// </summary>
-//
-// <returns>
-// Returns the ACE_HANDLE associated with this MgStreamData object.
-// </returns>
-ACE_HANDLE MgStreamData::GetHandle() const
-{
- return m_Handle;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Gets a pointer to the StreamHelper object that handles this objects
-// stream IO.
-// </summary>
-//
-// <returns>
-// Returns a pointer the a MgStreamHelper object.
-// </returns>
-MgStreamHelper* MgStreamData::GetStreamHelper()
-{
- return m_pStreamHelper;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Gets the version of this stream encapsulated by the MgStreamData object.
-// The version is not read from the stream automatically, but defaults
-// to zero.
-// </summary>
-//
-// <returns>
-// Returns this version of this stream.
-// </returns>
-UINT32 MgStreamData::GetVersion()
-{
- return m_Version;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Sets the version of the stream encapsulated by this MgStreamData object.
-// </summary>
-void MgStreamData::SetVersion( UINT32 version )
-{
- if ( version != 0 )
- {
- m_Version = version;
- }
- else
- {
- ACE_ERROR( ( LM_ERROR, ACE_TEXT( "MgStreamData Version cannot be zero" )));
- }
-
- return;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Gets the size of the data packet. This value is initialized to zero;
-// the actual value must be set manually.
-// </summary>
-//
-// <returns>
-// The size of the data stream in bytes.
-// </returns>
-INT64 MgStreamData::GetDataSize()
-{
- return m_DataSize;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Sets the size of the data packet. Note that this method has no effect
-// on the data stream or response itself; this property is merely for the
-// informational use of other objects.
-// </summary>
-//
-// <param name = "size">
-// The size in bytes of the undelying data packet.
-// </param>
-void MgStreamData::SetDataSize( INT64 size )
-{
- m_DataSize = size;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Gets the total number of bytes that have been read from the data section
-// of the stream.
-// </summary>
-//
-// <returns>
-// The amounnt of data read from the stream in bytes.
-// </returns>
-INT64 MgStreamData::GetDataRead()
-{
- return m_DataRead;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// Sets the total number of bytes that have been read from the stream.
-// </summary>
-//
-// <param name = "total">
-// The number of bytes that have been read from the data stream.
-// </param>
-void MgStreamData::SetDataRead( INT64 total )
-{
- m_DataRead = total;
-};
-
-#endif
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamData.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamData.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamData.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,80 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGSTREAMDATA_H_
-#define MGSTREAMDATA_H_
-
-#if WANT_ACE
-
-class MgStreamHelper;
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////
-// The StreamData class encapsulates the data pertaining to an
-// input/output stream.
-class MG_FOUNDATION_API MgStreamData : public ACE_Data_Block
-{
- DECLARE_CLASSNAME(MgStreamData)
-
- ///////////////////////////////////////////////////////////////////////
- /// Constructors/Destructors
- public:
-
- MgStreamData( ACE_HANDLE handle, MgStreamHelper* pStreamHelper );
- MgStreamData( MgStreamData & );
- virtual ~MgStreamData();
-
- ///////////////////////////////////////////////////////////////////////
- /// Accessors
- public:
-
- INT64 GetDataRead();
- void SetDataRead( INT64 total );
- INT64 GetDataSize();
- void SetDataSize( INT64 size );
- ACE_HANDLE GetHandle() const;
- MgStreamHelper* GetStreamHelper();
- UINT32 GetVersion();
- void SetVersion( UINT32 version );
-
- ///////////////////////////////////////////////////////////////////////
- /// Member Variables
- protected:
-
- /// the underlyng handle of the input/output stream
- const ACE_HANDLE m_Handle;
-
- /// the StreamHelper objec that handles IO for the stream
- Ptr<MgStreamHelper> m_pStreamHelper;
-
- /// the version of the stream behing read
- UINT32 m_Version;
-
- /// the size of the data payload of the stream
- INT64 m_DataSize;
-
- /// the number of bytes that have been read from the stream
- INT64 m_DataRead;
-
- /// the current error state of the stream
- bool m_bError;
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MGSTREAMDATA_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamHeader.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamHeader.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamHeader.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,25 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-/// \cond INTERNAL
-struct MG_FOUNDATION_API MgStreamHeader
-{
- UINT32 m_streamStart;
- UINT32 m_streamVersion;
- UINT32 m_streamDataHdr;
-};
-/// \endcond
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamHelper.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamHelper.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamHelper.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,134 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-#include "StreamHelper.h"
-
-#if WANT_ACE
-
-//-------------------------------------------------------------------------
-// Constructors/Destructors
-//-------------------------------------------------------------------------
-
-MgStreamHelper::MgStreamHelper()
-{
-}
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// The destructor for a MgStreamHelper object.
-// </summary>
-MgStreamHelper::~MgStreamHelper()
-{
-};
-
-void MgStreamHelper::Dispose()
-{
- delete this;
-}
-
-bool MgStreamHelper::IsConnected()
-{
- return true;
-}
-
-//////////////////////////////////////////////////////////////////
-/// \brief
-/// Standard protocol handling for strings, via the UTF-16 standard.
-/// Uses WriteBytes internally.
-///
-MgStreamHelper::MgStreamStatus MgStreamHelper::WriteString(CREFSTRING str)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssError;
-
- UINT8 charSize = sizeof(wchar_t);
- stat = WriteUINT8(charSize);
-
- UINT32 len = (UINT32) str.length()+1;
- if (mssDone == stat) stat = WriteUINT32(len);
- if (mssDone == stat) stat = WriteBytes((unsigned char*) str.c_str(), len*charSize);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-/// \brief
-/// Standard protocol handling for strings, via the UTF-16 standard.
-/// Uses GetData internally.
-///
-MgStreamHelper::MgStreamStatus MgStreamHelper::GetString(REFSTRING wcStr)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssError;
- UINT8 charSize = 0;
- stat = GetUINT8(charSize);
-
- UINT32 len = 0;
- if (mssDone == stat) stat = GetUINT32(len);
-
- if (mssDone != stat) return stat;
-
- // Check for 0 length string
- if(len == 0)
- {
- wcStr = L"";
- return stat;
- }
-
- UINT8 currSize = sizeof(wchar_t);
- if (currSize == charSize)
- {
- wcStr.reserve(len);
- wcStr.resize(len-1);
- stat = GetData( (void*)wcStr.c_str(), len*charSize , true, false );
- }
- else if (2 == currSize && 4 == charSize)
- {
- // Do UTF32 to UTF16 conversion
- LCh* wideStr = new LCh[len];
- stat = GetData( wideStr, len*charSize, true, false );
- if (mssDone == stat)
- {
- xstring xStr;
- FoundationUnicodeString::UTF32toUTF16(wideStr, xStr);
- wcStr = (wchar_t*) xStr.c_str();
- }
- delete [] wideStr;
- }
- else if (4 == currSize && 2 == charSize)
- {
- // Do UTF16 to UTF32 conversion
- XMLCh* wideStr = new XMLCh[len];
- stat = GetData( wideStr, len*charSize, true, false );
- if (mssDone == stat)
- {
- lstring lStr;
- FoundationUnicodeString::UTF16toUTF32(wideStr, lStr);
- wcStr = (wchar_t*) lStr.c_str();
- }
- delete [] wideStr;
- }
- else
- {
- throw new MgStreamIoException(L"MgStreamHelper.GetString", __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
- stat = MgStreamHelper::mssError;
- }
-
- return stat;
-}
-
-#endif //WANT_ACE
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamHelper.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamHelper.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamHelper.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,150 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_STREAM_HELPER_H_
-#define MG_STREAM_HELPER_H_
-
-#if WANT_ACE
-
-class MgStreamHelper;
-template class MG_FOUNDATION_API Ptr<MgStreamHelper>;
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////
-// The MgStreamHelper class provides an interface to read and write data
-// from an underlying stream.
-class MG_FOUNDATION_API MgStreamHelper : public MgGuardDisposable
-{
- ///////////////////////////////////////////////////////////////////////
- /// Constructors/Destructors
- public:
- MgStreamHelper();
- virtual ~MgStreamHelper();
-
- ///////////////////////////////////////////////////////////////////////
- /// Enumerations
- public:
-
- enum MgStreamStatus
- {
- mssError = 0x1111F901,
- mssDone = 0x1111F902,
- mssNotDone = 0x1111F903
- };
-
- ///////////////////////////////////////////////////////////////////////
- /// Methods
- public:
-
- ////////////////////////////////////
- ////////////////////////////////////
- /// Buffered Reader Methods
- virtual MgStreamStatus GetData( void* buffer, size_t size, bool blocking = true, bool peeking = false ) = 0;
-
- virtual MgStreamStatus GetUINT8( UINT8& data, bool blocking = true, bool peeking = false ) = 0;
-
- virtual MgStreamStatus GetUINT16( UINT16& data, bool blocking = true, bool peeking = false ) = 0;
-
- virtual MgStreamStatus GetUINT32( UINT32& data, bool blocking = true, bool peeking = false ) = 0;
-
- virtual MgStreamStatus GetINT64( INT64& data, bool blocking = true, bool peeking = false ) = 0;
-
- ////////////////////////////////////
- ////////////////////////////////////
- /// Cached Writing Methods
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a byte.
- ///
- /// \param value
- /// 8 bit byte to write
- ///
- virtual MgStreamStatus WriteUINT8( UINT8 value ) = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a TCP/IP 16 bit integer. This routine should make our
- /// data transfer platform independent
- ///
- /// \param value
- /// 16 bit integer to write
- ///
- virtual MgStreamStatus WriteUINT16( UINT16 value ) = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a TCP/IP 32 bit integer. This routine should make our
- /// data transfer platform independent
- ///
- /// \param value
- /// 32 bit integer to write
- ///
- virtual MgStreamStatus WriteUINT32( UINT32 value ) = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes a TCP/IP 64 bit integer. This routine should make our
- /// data transfer platform independent
- ///
- /// \param value
- /// 64 bit integer to write
- ///
- virtual MgStreamStatus WriteINT64( INT64 value ) = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Recursive routine to write an arbitrarily large input buffer to the stream
- /// If the input fits in our internal buffer, just use the internal buffer.
- ///
- virtual MgStreamStatus WriteBytes(const unsigned char* buf, int nBytes) = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Flushes internal memory buffer to stream helper. This method
- /// should be called once an entire packet has been assembled.
- ///
- virtual MgStreamStatus Flush() = 0;
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Returns whether or not stream is connected.
- ///
- virtual bool IsConnected();
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Standard protocol handling for strings, via the UTF-16 standard.
- /// Uses WriteBytes internally.
- ///
- virtual MgStreamStatus WriteString(CREFSTRING str);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Standard protocol handling for strings, via the UTF-16 standard.
- /// Uses GetData internally.
- ///
- virtual MgStreamStatus GetString(REFSTRING str);
-
- protected:
- virtual void Dispose();
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MG_STREAM_HELPER_H_
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamParser.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamParser.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamParser.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,247 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-
-#if WANT_ACE
-
-//-------------------------------------------------------------------------
-// Constructors and Destructors
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// The default constructor for a MgStreamParser object. However, since
-// this method is protected and this class is merely a wrapper for various
-// static methods, this constructor should never be called.
-// </summary>
-MgStreamParser::MgStreamParser( void )
-{
-};
-
-//-------------------------------------------------------------------------
-// Public Methods
-//-------------------------------------------------------------------------
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This static method reads and consumes the STREAM START header from the
-// stream encapsulted by the given StreamData* parameter. It sets the
-// version of the StreamData object during the read.
-// </summary>
-//
-// <param name = "pStreamData">
-// A pointer the the StreamData object that encapsulates the incoming and
-// outgoing stream information.
-// </param>
-//
-// <returns>
-// Returns true if successful; false otherwise.
-// </returns>
-bool MgStreamParser::ParseStreamHeader( MgStreamData* pStreamData )
-{
- ACE_ASSERT( pStreamData );
-
- bool ret = false;
-
- if ( pStreamData )
- {
- MgStreamHelper* pHelper = pStreamData->GetStreamHelper();
-
- UINT32 header = 0;
-
- MgStreamHelper::MgStreamStatus stat = pHelper->GetUINT32( header, true , false );
-
- if ( MgStreamHelper::mssDone == stat && MgStreamParser::mshStreamStart == header )
- {
- UINT32 version = 0;
-
- stat = pHelper->GetUINT32( version, true, false );
-
- if ( MgStreamHelper::mssDone == stat )
- {
- pStreamData->SetVersion( version );
-
- ret = true;
- }
- }
-
- if (false == ret)
- {
- // The stream may contain garbage when the connection is dropped for
- // some reason. This exception may be ignored to reduce noise.
- throw new MgInvalidStreamHeaderException(L"MgStreamParser.ParseStreamHeader",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
- else if (MgStreamParser::StreamVersion != pStreamData->GetVersion())
- {
- throw new MgStreamIoException(L"MgStreamParser.ParseStreamHeader",
- __LINE__, __WFILE__, NULL, L"MgInvalidTCPProtocol", NULL);
- }
- }
-
- return ret;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This static method reads and consumes the DATA header from the
-// stream encapsulted by the given StreamData* parameter.
-// </summary>
-//
-// <param name = "pStreamData">
-// A pointer the the StreamData object that encapsulates the incoming and
-// outgoing stream information.
-// </param>
-//
-// <returns>
-// Returns true if successful; false otherwise.
-// </returns>
-bool MgStreamParser::ParseDataHeader( MgStreamData* pStreamData )
-{
- ACE_ASSERT( pStreamData );
-
- bool ret = false;
-
- if ( pStreamData )
- {
- MgStreamHelper* pHelper = pStreamData->GetStreamHelper();
-
- UINT32 header = 0;
-
- MgStreamHelper::MgStreamStatus stat = pHelper->GetUINT32( header, true, false );
-
- if ( MgStreamHelper::mssDone == stat && MgStreamParser::mshStreamData == header )
- {
- ret = true;
- }
- }
-
- return ret;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This static method reads and consumes the STREAM END header from the
-// stream encapsulted by the given StreamData* parameter.
-// </summary>
-//
-// <param name = "pStreamData">
-// A pointer the the StreamData object that encapsulates the incoming and
-// outgoing stream information.
-// </param>
-//
-// <returns>
-// Returns true if successful; false otherwise.
-// </returns>
-bool MgStreamParser::ParseEndHeader( MgStreamData* pStreamData )
-{
- ACE_ASSERT( pStreamData );
-
- bool ret = false;
-
- if ( pStreamData )
- {
- MgStreamHelper* pHelper = pStreamData->GetStreamHelper();
-
- UINT32 header = 0;
-
- MgStreamHelper::MgStreamStatus stat = pHelper->GetUINT32( header, true, false );
-
- if ( MgStreamHelper::mssDone == stat && MgStreamParser::mshStreamEnd == header )
- {
- ret = true;
- }
- }
-
- return ret;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This static method writes a STREAM START header to the
-// stream encapsulted by the given StreamData* parameter.
-// </summary>
-//
-// <param name = "pStreamData">
-// A pointer the the StreamData object that encapsulates the incoming and
-// outgoing stream information.
-// </param>
-//
-// <returns>
-// Returns true if successful; false otherwise.
-// </returns>
-bool MgStreamParser::WriteStreamHeader( MgStreamData* pStreamData )
-{
- ACE_ASSERT ( pStreamData );
-
- bool ret = false;
-
- if ( pStreamData )
- {
- MgStreamHelper* pHelper = pStreamData->GetStreamHelper();
-
- MgStreamHelper::MgStreamStatus stat = pHelper->WriteUINT32( MgStreamParser::mshStreamStart );
-
- if ( MgStreamHelper::mssDone == stat )
- {
- //stat = pHelper->WriteUINT32( pStreamData->GetVersion() );
- stat = pHelper->WriteUINT32( 1 ); // TODO: majik number
-
- ret = ( stat != MgStreamHelper::mssDone ) ? false : true;
- }
- }
-
- return ret;
-};
-
-///////////////////////////////////////////////////////////////////////////
-// <summary>
-// This static method writes a STREAM END header to the
-// stream encapsulted by the given StreamData* parameter.
-// </summary>
-//
-// <param name = "pStreamData">
-// A pointer the the StreamData object that encapsulates the incoming and
-// outgoing stream information.
-// </param>
-//
-// <returns>
-// Returns true if successful; false otherwise.
-// </returns>
-bool MgStreamParser::WriteEndHeader( MgStreamData* pStreamData )
-{
- ACE_ASSERT( pStreamData );
-
- bool ret = false;
-
- if ( pStreamData )
- {
- MgStreamHelper* pHelper = pStreamData->GetStreamHelper();
-
- MgStreamHelper::MgStreamStatus stat = pHelper->WriteUINT32( MgStreamParser::mshStreamEnd );
-
- ret = ( stat != MgStreamHelper::mssDone ) ? false : true;
- }
-
- return ret;
-};
-
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamParser.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamParser.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamParser.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,67 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MGSTREAMPARSER_H_MG
-#define MGSTREAMPARSER_H_MG
-
-#if WANT_ACE
-
-class MgStreamData;
-
-/// \cond INTERNAL
-///////////////////////////////////////////////////////////////////////////
-// The MgStreamParser class wraps static methods that allow parsing of
-// stream structures.
-class MG_FOUNDATION_API MgStreamParser
-{
- DECLARE_CLASSNAME(MgStreamParser)
-
- ///////////////////////////////////////////////////////////////////////
- /// Constructor/Destructor
- protected :
- MgStreamParser( void );
-
- ///////////////////////////////////////////////////////////////////////
- /// Enumerations
- public :
- enum MgStreamHeader
- {
- mshStreamStart = 0x1111F801,
- mshStreamData = 0x1111F802,
- mshStreamEnd = 0x1111F803
- };
-
- // Stream version follows a 16 bit major, 16 bit minor
- // convention. Minors should be interop compatible.
- // Major versions are not.
- static const UINT32 StreamVersion = (3<<16) + 0;
-
- ///////////////////////////////////////////////////////////////////////
- /// Methods
- public :
- static bool ParseStreamHeader( MgStreamData* pStreamData );
- static bool ParseDataHeader( MgStreamData* pStreamData );
- static bool ParseEndHeader( MgStreamData* pStreamData );
-
- static bool WriteStreamHeader( MgStreamData* pStreamData );
- static bool WriteEndHeader( MgStreamData* pStreamData );
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // MGSTREAMPARSER_H_MG
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamReader.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamReader.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamReader.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,609 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-#include "ByteSourceSocketStreamImpl.h"
-
-#if WANT_ACE
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Constructors
-///</summary>
-///<param name="streamHelper">
-/// Stream helper object holding ACE_SOCK_STREAM
-///</param>
-MgStreamReader::MgStreamReader( MgStreamHelper* streamHelper )
-:
-m_conn(NULL)
-{
- m_sHelper = SAFE_ADDREF(streamHelper);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Destructor
-///</summary>
-MgStreamReader::~MgStreamReader()
-{
- if (m_sHelper != NULL)
- {
- m_sHelper = NULL;
- }
- m_conn = NULL;
-}
-
-///<summary>
-/// Reads the stream header
-///</summary>
-///<param name="msh">
-///Stream header to hold the data
-///<param>
-void MgStreamReader::GetStreamHeader(MgStreamHeader& msh)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetStreamHeader");
-
- // Stream header
- m_sHelper->GetUINT32( msh.m_streamStart );
- // Stream version
- m_sHelper->GetUINT32( msh.m_streamVersion );
- // Stream data header
- m_sHelper->GetUINT32( msh.m_streamDataHdr );
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the operation header to the server
-///</summary>
-///<param name="serviceId">
-/// serviceId like ResourceService, DrawingService etc.
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetOperationHeader(MgOperationPacket& operPacket)
-{
- MG_TRY()
- throw new MgNotImplementedException(L"MgStreamReader.GetOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
- MG_CATCH_AND_THROW(L"MgStreamReader.GetOperationHeader")
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Gets the response header from the server
-///</summary>
-///<param name="packetHeader">
-/// Outparameter , packet header received.
-///</param>
-void MgStreamReader::GetOperationResponseHeader(MgOperationResponsePacket& mop)
-{
- MG_TRY()
- throw new MgNotImplementedException(L"MgStreamReader.GetOperationResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
- MG_CATCH_AND_THROW(L"MgStreamReader.GetOperationResponseHeader")
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Gets the header from the server
-///</summary>
-void MgStreamReader::GetArgumentHeader(MgArgumentPacket& map)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.ReadArgumentHeader");
-
- // Read packet header
- m_sHelper->GetUINT32( map.m_PacketHeader, true, false );
- // Read argument type
- m_sHelper->GetUINT32( map.m_ArgumentType, true, false );
- // Read length if it is string
- if (map.m_ArgumentType == (UINT32)MgPacketParser::matString)
- {
- UINT32 strLen = 0;
- m_sHelper->GetUINT32(strLen);
- map.m_Length = strLen;
- }
-}
-
-
-void MgStreamReader::GetBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetBinaryStreamHeader");
-
- // Packet header
- m_sHelper->GetUINT32(bsap.m_PacketHeader);
- // Argument type
- m_sHelper->GetUINT32(bsap.m_ArgumentType);
- // Stream version
- m_sHelper->GetUINT32(bsap.m_Version);
- // Stream size
- m_sHelper->GetINT64(bsap.m_Length);
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the string from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetString(REFSTRING wcStr)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetString");
-
- MgArgumentPacket map;
-
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matString)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetString",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_sHelper->GetString(wcStr);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the int64 from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetInt64(INT64& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetInt64");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT64)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetInt64",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_sHelper->GetINT64(value);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the int32 from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetInt32(INT32& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetInt32");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT32)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetInt32",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- UINT32 uVal = 0;
- m_sHelper->GetUINT32(uVal);
- value = (INT32) uVal;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the int16 from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetInt16(INT16& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetInt16");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT16)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetInt16",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- UINT16 val;
- m_sHelper->GetUINT16(val);
- value = val;
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the float from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetSingle(float& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetSingle");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matFloat)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetSingle",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_sHelper->GetData( &value, sizeof(float), true, false );
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the double from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetDouble(double& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetDouble");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matDouble)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetDouble",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- m_sHelper->GetData( &value, sizeof(double), true, false );
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the boolean from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetBoolean(bool& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetBoolean");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT8)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetBoolean",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- UINT8 tempValue;
- m_sHelper->GetUINT8(tempValue);
- value = (bool)tempValue;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the byte from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetByte(BYTE& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetByte");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if (map.m_ArgumentType != (UINT32)MgPacketParser::matINT8)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetByte",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- UINT8 val;
- m_sHelper->GetUINT8(val);
- value = val;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the stream from the server
-///</summary>
-///<returns>
-/// ByteReader
-///</returns>
-MgByteReader* MgStreamReader::GetStream(bool enableDirect)
-{
- Ptr<MgByteReader> byteReader;
- char* temp = NULL;
-
- MG_TRY()
-
- CHECKNULL(m_sHelper, L"MgStreamReader.GetStream");
-
- MgBinaryStreamArgumentPacket bsap;
-
- GetBinaryStreamHeader(bsap);
-
- if (bsap.m_ArgumentType != (UINT32)MgPacketParser::mphArgumentBinaryStream)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetStream",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- bool isNullByteReader = false;
- GetBoolean(isNullByteReader);
-
- if (isNullByteReader)
- {
- return NULL;
- }
-
- ACE_HANDLE file = ACE_INVALID_HANDLE;
- Ptr<MgByte> bytes;
- STRING tempName;
-
- if (m_conn != NULL && enableDirect)
- {
- // Direct streaming semantics. If our stream is backed by a ServerConnection
- // then we must be reading a server response. Pass control of the ServerConnection
- // to our direct bound stream implementation
- ByteSourceSocketStreamImpl* socketSource = new ByteSourceSocketStreamImpl(bsap.m_Length, GetConnection());
- Ptr<MgByteSource> ptrByteSource = new MgByteSource(socketSource);
- byteReader = ptrByteSource->GetReader();
-
- return byteReader.Detach();
- }
- else if (bsap.m_Length > MgByte::MaxSize)
- {
- // Very large data set. Use a file backed stream instead of
- // sucking back huge globs of virtual memory.
- tempName = MgFileUtil::GenerateTempFileName();
-
- file = ACE_OS::creat(MG_WCHAR_TO_TCHAR(tempName), 0);
- if (ACE_INVALID_HANDLE == file)
- {
- MgStringCollection arguments;
- arguments.Add(tempName);
-
- if (errno == EEXIST)
- {
- throw new MgFileNotFoundException(L"MgStreamReader.GetStream",
- __LINE__, __WFILE__, &arguments, L"", NULL);
- }
- else
- {
- throw new MgFileIoException(L"MgStreamReader.GetStream",
- __LINE__, __WFILE__, &arguments, L"", NULL);
- }
- }
- }
- else
- {
- bytes = new MgByte(NULL, (INT32)bsap.m_Length);
- }
-
- UINT32 allocLen = 0;
- UINT32 len = 0;
-
- do
- {
- // Read the length
- m_sHelper->GetUINT32( len, true, false );
- if ( len > 0 )
- {
- if (len > allocLen)
- {
- delete [] temp;
- temp = new char[len];
- allocLen = len;
- }
-
- // Read the data
- MgStreamHelper::MgStreamStatus stat = GetData(temp, len);
- if (MgStreamHelper::mssDone == stat)
- {
- if (ACE_INVALID_HANDLE == file)
- {
- bytes->Append((BYTE_ARRAY_IN)temp, len);
- }
- else
- {
- ssize_t dataWritten = 0;
- while (dataWritten < len)
- {
- ssize_t written = ACE_OS::write(file, &temp[dataWritten], len-dataWritten);
- if (written > 0)
- {
- dataWritten += written;
- }
- }
- }
- }
- }
- } while ( len > 0 );
-
- if (ACE_INVALID_HANDLE == file)
- {
- Ptr<MgByteSource> ptrByteSource = new MgByteSource(bytes);
- byteReader = ptrByteSource->GetReader();
- }
- else
- {
- ACE_OS::close(file);
- Ptr<MgByteSource> ptrByteSource = new MgByteSource(tempName, true);
- byteReader = ptrByteSource->GetReader();
- }
-
- MG_CATCH(L"MgStreamReader.GetStream")
-
- delete [] temp;
-
- MG_THROW()
-
- return byteReader.Detach();
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the data from the server
-///</summary>
-///<param name="value">
-/// Value to be read
-///</param>
-///<returns>
-/// size of data read
-///</returns>
-MgStreamHelper::MgStreamStatus MgStreamReader::GetData(void* value, INT32 length)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetData");
-
- return m_sHelper->GetData( value, length , true, false);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This reads the class id argument packet from the server
-///</summary>
-///<param name="value">
-/// value to be read.
-///</param>
-///<returns>
-///Nothing
-///</returns>
-void MgStreamReader::GetClassId(INT32& value)
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetClassId");
-
- MgArgumentPacket map;
- GetArgumentHeader(map);
-
- if ((UINT32)MgPacketParser::matClassId != map.m_ArgumentType)
- {
- throw new MgInvalidStreamHeaderException(L"MgStreamReader.GetClassId",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-
- UINT32 uVal = 0;
- m_sHelper->GetUINT32(uVal);
- value = (INT32) uVal;
-}
-
-///<summary>
-/// Reads the end of stream header
-///</summary>
-///<returns>
-/// Nothing
-///</returns>
-void MgStreamReader::GetStreamEnd()
-{
- CHECKNULL(m_sHelper, L"MgStreamReader.GetStreamEnd");
-
- UINT32 dataRead;
- m_sHelper->GetUINT32( dataRead );
-
- if ( MgStreamParser::mshStreamEnd != dataRead )
- {
- throw new MgInvalidStreamHeaderException( L"MgStreamReader.GetStreamEnd",
- __LINE__, __WFILE__, NULL, L"", NULL);
- }
-}
-
-
-///<summary>
-/// Reads the Object from stream
-///</summary>
-///<returns>
-/// MgObject pointer
-///</returns>
-MgObject* MgStreamReader::GetObject()
-{
- INT32 classId;
- GetClassId(classId);
-
- if(classId == 0) //NULL pointer to object
- return NULL;
-
- Ptr<MgSerializable> obj = (MgSerializable*)MgUtil::CreateMgObject(classId); // throws NullPointerException
- //deserialize the object
- obj->Deserialize((MgStream*)this);
-
- return obj.Detach();
-}
-
-///<summary>
-/// Returns the stream helper contained by this stream
-///</summary>
-///
-MgStreamHelper* MgStreamReader::GetStreamHelper()
-{
- return SAFE_ADDREF(m_sHelper.p);
-}
-
-///<summary>
-/// Returns the connection this stream belongs to
-///</summary>
-///
-MgServerConnectionBase* MgStreamReader::GetConnection()
-{
- return SAFE_ADDREF(m_conn);
-}
-
-///<summary>
-/// Sets the connection this stream belongs to
-///</summary>
-///
-void MgStreamReader::SetConnection(MgServerConnectionBase* conn)
-{
- m_conn = conn;
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamReader.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamReader.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamReader.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,260 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef _MGSTREAMREADER_H_
-#define _MGSTREAMREADER_H_
-
-#if WANT_ACE
-
-/// INTERNAL_CLASS
-/// \cond INTERNAL
-class MgServerConnection;
-
-class MG_FOUNDATION_API MgStreamReader
-{
- DECLARE_CLASSNAME(MgStreamReader)
-
-INTERNAL_API:
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Constructors
- ///
- /// \param streamHelper
- /// Stream helper object holding ACE_SOCK_STREAM
- ///
- MgStreamReader( MgStreamHelper* streamHelper );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destructor
- ///
- virtual ~MgStreamReader();
-
- /// \brief
- /// Reads the stream header
- ///
- /// \param msh
- /// Stream header to hold the data
- ///
- virtual void GetStreamHeader(MgStreamHeader& msh);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the operation header to the server
- ///
- /// \param serviceId
- /// serviceId like ResourceService, DrawingService etc.
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetOperationHeader(MgOperationPacket& operPacket);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the response header from the server
- ///
- /// \param packetHeader
- /// Outparameter , packet header received.
- ///
- virtual void GetOperationResponseHeader(MgOperationResponsePacket& mop);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the header from the server
- ///
- virtual void GetArgumentHeader(MgArgumentPacket& map);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the binary stream header from the server
- ///
- virtual void GetBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the string from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetString(REFSTRING wcStr);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the int64 from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetInt64(INT64& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the int32 from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetInt32(INT32& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the int16 from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetInt16(INT16& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the float from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetSingle(float& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the double from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetDouble(double& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the boolean from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetBoolean(bool& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the byte from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetByte(BYTE& value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the stream from the server
- ///
- /// \return
- /// ByteReader
- ///
- virtual MgByteReader* GetStream(bool enableDirect = false);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the data from the server
- ///
- /// \param value
- /// Value to be read
- ///
- /// \return
- /// size of data read
- ///
- virtual MgStreamHelper::MgStreamStatus GetData(void* value, INT32 length);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This reads the class id argument packet from the server
- ///
- /// \param value
- /// value to be read.
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetClassId(INT32& value);
-
- /// \brief
- /// Reads the end of stream header
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetStreamEnd();
-
- /// \brief
- /// Reads the Object from stream
- ///
- /// \return
- /// MgObject pointer
- ///
- virtual MgObject* GetObject();
-
- /// \brief
- /// Returns the stream helper contained by this stream
- ///
- ///
- MgStreamHelper* GetStreamHelper();
-
- /// \brief
- /// Returns the connection this stream belongs to
- ///
- ///
- MgServerConnectionBase* GetConnection();
-
- /// \brief
- /// Sets the connection this stream belongs to
- ///
- ///
- void SetConnection(MgServerConnectionBase* conn);
-
-protected:
- Ptr<MgStreamHelper> m_sHelper;
- MgServerConnectionBase* m_conn; // raw pointer to avoid circular dependency
-};
-/// \endcond
-
-#endif //WANT_ACE
-
-#endif // _MGSTREAMREADER_H_
-
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamWriter.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamWriter.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamWriter.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,478 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#include "stdafx.h"
-#include "Foundation.h"
-
-#if WANT_ACE
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Constructors
-///</summary>
-MgStreamWriter::MgStreamWriter( MgStreamHelper* streamHelper )
-{
- m_sHelper = SAFE_ADDREF(streamHelper);
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Destructor
-///</summary>
-MgStreamWriter::~MgStreamWriter()
-{
- if (m_sHelper != NULL)
- {
- m_sHelper = NULL;
- }
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Writes the stream header
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteStreamHeader(MgStreamHeader& msh)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- // Stream header
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32( msh.m_streamStart );
- // Stream version
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32( msh.m_streamVersion );
- // Stream data header
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32( msh.m_streamDataHdr );
-
- return stat;
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the operation header to the server
-///</summary>
-///<param name="operPacket">
-/// Operation packet to write
-///</param>
-///<returns>
-/// Stream status of write
-///</returns>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteOperationHeader(MgOperationPacket& operPacket)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MG_TRY()
- throw new MgNotImplementedException(L"MgStreamWriter.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
- MG_CATCH_AND_THROW(L"MgStreamWriter.WriteOperationHeader")
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Writes the stream header to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- // Packet header
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32(bsap.m_PacketHeader);
- // Argument type
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32(bsap.m_ArgumentType);
- // Stream version
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32(bsap.m_Version);
- // Stream size
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteINT64(bsap.m_Length);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Writes the response header from the server
-///</summary>
-///<param name="eCode">
-/// eCode to send.
-///</param>
-///<param name="retValues">
-/// no. of return arguments .
-///</param>
-///<returns>
-/// Stream status
-///</returns>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteOperationResponseHeader( MgOperationResponsePacket& mop )
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- if (MgStreamHelper::mssDone == stat) stat = MgStreamWriter::m_sHelper->WriteUINT32( mop.m_PacketHeader );
- // Version
- if (MgStreamHelper::mssDone == stat) stat = MgStreamWriter::m_sHelper->WriteUINT32( mop.m_PacketVersion );
- // Get the code
- if (MgStreamHelper::mssDone == stat) stat = MgStreamWriter::m_sHelper->WriteUINT32( mop.m_ECode );
- // No. of return values
- if (MgStreamHelper::mssDone == stat) stat = MgStreamWriter::m_sHelper->WriteUINT32( mop.m_NumReturnValues );
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// Writes the header to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteArgumentHeader(MgArgumentPacket& map)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- // Write packet header
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32( map.m_PacketHeader );
- // Write argument type
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32( map.m_ArgumentType );
- // Write length if it is string
- if (MgStreamHelper::mssDone == stat
- && MgPacketParser::matString == map.m_ArgumentType)
- {
- stat = m_sHelper->WriteUINT32((UINT32)map.m_Length);
- }
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the string argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteString(CREFSTRING value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matString;
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteString(value);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the int64 argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteInt64(INT64 value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matINT64;
- map.m_Length = sizeof(INT64);
-
- stat = WriteArgumentHeader(map);
-
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteINT64(value);
-
- return stat;
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the int32 argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteInt32(INT32 value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matINT32;
- map.m_Length = sizeof(UINT32);
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32((UINT32)value);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the int16 argument packet to the server
-///</summary>
-///<param name="value">
-/// value to be written.
-///</param>
-///<returns>
-///Nothing
-///</returns>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteInt16(INT16 value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matINT16;
- map.m_Length = sizeof(INT16);
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT16(value);
-
- return stat;
-}
-
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the float argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteSingle(float value)
-{
-
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matFloat;
- map.m_Length = sizeof(float);
-
- stat = WriteArgumentHeader(map);
-
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteBytes((const unsigned char*)&value, (int) map.m_Length);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the double argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteDouble(double value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matDouble;
- map.m_Length = sizeof(double);
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteBytes((const unsigned char*)&value, (int) map.m_Length);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the boolean argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteBoolean(bool value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matINT8;
- map.m_Length = sizeof(INT8);
- UINT8 intVal = value;
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT8(intVal);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the byte argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteByte(BYTE value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matINT8;
- map.m_Length = sizeof(BYTE);
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT8((UINT8)value);
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the stream to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteStream(MgByteReader* byteReader)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgBinaryStreamArgumentPacket bsap;
-
- // Packet header
- bsap.m_PacketHeader = (UINT32)MgPacketParser::matStream;
- // Argument type
- bsap.m_ArgumentType = (UINT32)MgPacketParser::mphArgumentBinaryStream;
- // Stream version
- bsap.m_Version = MG_STREAM_VERSION;
- // Stream size
- bsap.m_Length = 0;
-
- if (byteReader != NULL)
- {
- bsap.m_Length = byteReader->GetLength();
- }
-
- stat = WriteBinaryStreamHeader(bsap);
-
- // We need to send flag here because '0' length byte reader is a possible
- // scenario where byte reader may not be null. To handle both situations
- // correctly, we need to inform that whether it is null or zero byte based bytereader.
- bool isNullByteReader = false;
- if (byteReader != NULL)
- {
- WriteBoolean(isNullByteReader); // Non-Null byte reader
- }
- else
- {
- isNullByteReader = true;
- WriteBoolean(isNullByteReader); // Null object
- }
-
- if (byteReader != NULL)
- {
- unsigned char buf[8192];
- INT32 len = byteReader->Read(buf,8192);
-
- while (len != 0 && MgStreamHelper::mssDone == stat)
- {
- // Write the length
- stat = m_sHelper->WriteUINT32(len);
- // Write the data
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteBytes(buf, len);
-
- if (MgStreamHelper::mssDone == stat) len = byteReader->Read(buf,8192);
- }
-
- UINT32 end = 0;
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32(end);
- }
-
- return stat;
-}
-
-//////////////////////////////////////////////////////////////////
-///<summary>
-/// This writes the class id argument packet to the server
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteClassId(INT32 value)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgArgumentPacket map;
- map.m_PacketHeader = (UINT32)MgPacketParser::mphArgumentSimple;
- map.m_ArgumentType = (UINT32)MgPacketParser::matClassId;
- map.m_Length = sizeof(INT32);
-
- stat = WriteArgumentHeader(map);
- if (MgStreamHelper::mssDone == stat) stat = m_sHelper->WriteUINT32((UINT32)value);
-
- return stat;
-}
-
-///<summary>
-/// Writes the end of stream header
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteStreamEnd()
-{
- MgStreamHelper::MgStreamStatus stat = m_sHelper->WriteUINT32( MgStreamParser::mshStreamEnd );
- m_sHelper->Flush();
-
- return stat;
-}
-
-///<summary>
-/// Writes the Object to stream
-///</summary>
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteObject(MgObject* obj)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- //serialize this object or just send a class id representing a NULL object
- if(obj != NULL)
- {
- stat = WriteClassId(obj->GetClassId());
- //serialize the object
- if (MgStreamHelper::mssDone == stat) ((MgSerializable*)obj)->Serialize((MgStream*)this);
- }
- else
- {
- stat = WriteClassId(0);
- }
-
- return stat;
-}
-
-
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteResponseHeader(MgPacketParser::MgECode eCode, UINT32 noOfRetValues)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- MgStreamHeader msh;
- msh.m_streamStart = (UINT32)MgStreamParser::mshStreamStart;
- msh.m_streamVersion = MgStreamParser::StreamVersion;
- msh.m_streamDataHdr = (UINT32)MgStreamParser::mshStreamData;
-
- stat = WriteStreamHeader(msh);
-
- MgOperationResponsePacket morp;
- morp.m_ECode = (UINT32)eCode;
- morp.m_NumReturnValues = noOfRetValues;
- morp.m_PacketHeader = MgPacketParser::mphOperationResponse;
- morp.m_PacketVersion = 1;
-
- if (MgStreamHelper::mssDone == stat) stat = WriteOperationResponseHeader(morp);
-
- return stat;
-}
-
-MgStreamHelper::MgStreamStatus MgStreamWriter::WriteControlPacket(MgControlPacket& packet)
-{
- MgStreamHelper::MgStreamStatus stat = MgStreamHelper::mssDone;
-
- // Send stream header
- MgStreamHeader msh;
- msh.m_streamStart = (UINT32) MgStreamParser::mshStreamStart;
- msh.m_streamVersion = MgStreamParser::StreamVersion;
- msh.m_streamDataHdr = MgStreamParser::mshStreamData;
-
- stat = WriteStreamHeader(msh);
-
- // Send control packet
- m_sHelper->WriteUINT32((UINT32)packet.m_PacketHeader);
- m_sHelper->WriteUINT32((UINT32)packet.m_PacketVersion);
- m_sHelper->WriteUINT32((UINT32)packet.m_ControlID);
-
- // End stream
- if (MgStreamHelper::mssDone == stat) stat = WriteStreamEnd();
-
- return stat;
-}
-
-#endif //WANT_ACE
\ No newline at end of file
Deleted: sandbox/adsk/vik/Common/Foundation/System/StreamWriter.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/StreamWriter.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/StreamWriter.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -1,276 +0,0 @@
-//
-// Copyright (C) 2004-2011 by Autodesk, Inc.
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of version 2.1 of the GNU Lesser
-// General Public License as published by the Free Software Foundation.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-//
-
-#ifndef MG_STREAM_WRITER_H
-#define MG_STREAM_WRITER_H
-
-#if WANT_ACE
-
-class MgPacketParser;
-
-/// \cond INTERNAL
-class MG_FOUNDATION_API MgStreamWriter
-{
- DECLARE_CLASSNAME(MgStreamWriter)
-
-INTERNAL_API:
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Constructors
- ///
- /// \param streamHelper
- /// Stream helper object holding ACE_SOCK_STREAM
- ///
- MgStreamWriter( MgStreamHelper* streamHelper );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Destructor
- ///
- virtual ~MgStreamWriter();
-
- /// \brief
- /// Writes the stream header
- ///
- /// \param msh
- /// Stream header to hold the data
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteStreamHeader(MgStreamHeader& msh);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the operation header to the server
- ///
- /// \param operPacket
- /// Operation packet to write
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteOperationHeader(MgOperationPacket& operPacket);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the stream header to the server
- ///
- virtual MgStreamHelper::MgStreamStatus WriteBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the response header from the server
- ///
- /// \param eCode
- /// eCode to send.
- /// \param retValues
- /// no. of return arguments.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteOperationResponseHeader( MgOperationResponsePacket& mop );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the header to the server
- ///
- virtual MgStreamHelper::MgStreamStatus WriteArgumentHeader(MgArgumentPacket& map);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the string argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteString(CREFSTRING value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the int64 argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteInt64(INT64 value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the int32 argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteInt32(INT32 value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the int16 argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream Status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteInt16(INT16 value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the float argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteSingle(float value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the double argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteDouble(double value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the boolean argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteBoolean(bool value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the byte argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteByte(BYTE value);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the stream to the server
- ///
- /// \param byteReader
- /// ByteReader from which stream to be taken
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteStream(MgByteReader* byteReader);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the class id argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteClassId(INT32 value);
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the end of stream header
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteStreamEnd();
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the Object to stream
- ///
- /// <param>
- /// ClassId of object to be sent
- /// </param>
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteObject(MgObject* obj);
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the Stream header and Operation header for version 1 stream
- ///
- /// \param eCode
- /// Code specifies whether it is success or failure or success with warnings
- /// \param noOfRetValues
- /// No of return values being sent
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteResponseHeader(MgPacketParser::MgECode eCode, UINT32 noOfRetValues);
-
- /////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes stream header, control packet, and stream end to the stream
- ///
- /// \param packet
- /// Control packet to write to stream
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteControlPacket(MgControlPacket& packet);
-
-protected:
-
- //////////////////////////
- /// Private member data
- Ptr<MgStreamHelper> m_sHelper;
-};
-/// \endcond
-
-#define MG_STREAM_VERSION 1
-
-#endif //WANT_ACE
-
-#endif // MG_STREAM_WRITER_H
-
Modified: sandbox/adsk/vik/Common/Foundation/System/Util.cpp
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/Util.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/Util.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -199,12 +199,7 @@
}
catch (int)
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(wcStr);
-
- throw new MgException(L"MgUtil.WideCharToMultiByte",
- __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
+ throw new MgException(L"MgInvalidStringConversion: " + wcStr);
}
}
@@ -238,12 +233,7 @@
}
catch (int)
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add((NULL == wcBuf) ? L"" : wcBuf);
-
- throw new MgException(L"MgUtil.WideCharToMultiByte",
- __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
+ throw new MgException(STRING(L"InvalidStringConversion : ") + (wcBuf ? wcBuf : L""));
}
char* mbBuf = 0;
@@ -304,12 +294,7 @@
}
catch (int)
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(L"const string&");
-
- throw new MgException(L"MgUtil.WideCharToMultiByte",
- __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
+ throw new MgException(L"MgInvalidStringConversion");
}
}
@@ -343,12 +328,7 @@
}
catch (int)
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(L"const char*");
-
- throw new MgException(L"MgUtil.WideCharToMultiByte",
- __LINE__, __WFILE__, &arguments, L"MgInvalidStringConversion", NULL);
+ throw new MgException(L"MgInvalidStringConversion");
}
wchar_t* wcBuf = 0;
@@ -499,15 +479,7 @@
if ( index >= 0 )
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(str);
-
- MgStringCollection whyArguments;
- whyArguments.Add(reservedChars);
-
- throw new MgException(L"CheckReseveredCharater",
- __LINE__, __WFILE__, &arguments, L"MgStringContainsReservedCharacters", &whyArguments);
+ throw new MgException(L"MgStringContainsReservedCharacters: " + str);
}
}
@@ -548,12 +520,7 @@
{
if (NULL != wcschr(sChar.c_str(), str[0]) || NULL != wcschr(sChar.c_str(), str[orgLen-1]) )
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(str);
-
- throw new MgException(L"MgUtil.CheckBeginEnd",
- __LINE__, __WFILE__, &arguments, L"MgInvalidStringTrim", NULL);
+ throw new MgException(L"MgInvalidStringTrim: " + str);
}
}
}
@@ -592,8 +559,7 @@
{
if (NULL == oldValue || NULL == newValue)
{
- throw new MgException(L"MgUtil.ReplaceString",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
STRING newStr = str.c_str();
Modified: sandbox/adsk/vik/Common/Foundation/System/Util.h
===================================================================
--- sandbox/adsk/vik/Common/Foundation/System/Util.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Foundation/System/Util.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -591,15 +591,13 @@
#define CHECKNULL(pointer, methodname) \
if (pointer == NULL) \
{ \
- throw new MgException(methodname, \
- __LINE__, __WFILE__, NULL, L"NullReference", NULL); \
+ throw new MgException(L"NullReference"); \
}
#define CHECKARGUMENTNULL(pointer, methodname) \
if (pointer == NULL) \
{ \
- throw new MgException(methodname, \
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL); \
+ throw new MgException(L"NullArgument"); \
}
#define MG_CHECK_RANGE(value, min, max, methodName) \
@@ -607,8 +605,7 @@
{ \
if (NULL != methodName) \
{ \
- throw new MgException( \
- methodName, __LINE__, __WFILE__, NULL, L"ArgumentOutOfRange", NULL); \
+ throw new MgException(L"ArgumentOutOfRange"); \
} \
else if (value < min) \
{ \
Modified: sandbox/adsk/vik/Common/Geometry/AgfStream.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/AgfStream.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/AgfStream.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -154,125 +154,5 @@
}
//////////////////////////////////////////////////////////////////
-//////////////////////////////////////////////////////////////////
-// The following methods are not applicable to the AgfStream. They
-// overriden for the sole purpose of throwing an exception when called
-// by mistake, rather than producing an unpredictable result.
-//
-void MgAgfStream::GetStreamHeader(MgStreamHeader& msh)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-void MgAgfStream::GetOperationHeader(MgOperationPacket& operPacket)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-void MgAgfStream::GetOperationResponseHeader(MgOperationResponsePacket& mop)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetOperationResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-void MgAgfStream::GetArgumentHeader(MgArgumentPacket& map)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetArgumentHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-void MgAgfStream::GetBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetBinaryStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgByteReader* MgAgfStream::GetStream()
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetStream", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::GetData(void* value, INT32 length)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetData", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-void MgAgfStream::GetClassId(INT32& value)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetClassId", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-void MgAgfStream::GetStreamEnd()
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetStreamEnd", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-
-MgObject* MgAgfStream::GetObject()
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetObject", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-void MgAgfStream::GetString(REFSTRING wcStr)
-{
- throw new MgNotImplementedException(L"MgAgfStream.GetString", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteStreamHeader(MgStreamHeader& msh)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteOperationHeader(MgOperationPacket& operPacket)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteOperationHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteOperationResponseHeader( MgOperationResponsePacket& mop )
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteBinaryStreamHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteArgumentHeader(MgArgumentPacket& map)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteArgumentHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteString(CREFSTRING value)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteString", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteStream(MgByteReader* byteReader)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteStream", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteClassId(INT32 value)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteClassId", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteStreamEnd()
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteStreamEnd", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteObject(MgObject* obj)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteObject", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteResponseHeader(MgPacketParser::MgECode eCode, UINT32 noOfRetValues)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteResponseHeader", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
-MgStreamHelper::MgStreamStatus MgAgfStream::WriteControlPacket(MgControlPacket& packet)
-{
- throw new MgNotImplementedException(L"MgAgfStream.WriteControlPacket", __LINE__, __WFILE__, NULL, L"", NULL);
-}
-
#endif //WANT_ACE
\ No newline at end of file
Modified: sandbox/adsk/vik/Common/Geometry/AgfStream.h
===================================================================
--- sandbox/adsk/vik/Common/Geometry/AgfStream.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/AgfStream.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -142,50 +142,9 @@
///
virtual void GetByte(BYTE& value);
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Reads the stream header
- ///
- /// \param msh
- /// Stream header to hold the data
- ///
- virtual void GetStreamHeader(MgStreamHeader& msh);
//////////////////////////////////////////////////////////////////
/// \brief
- /// This writes the operation header to the server
- ///
- /// \param serviceId
- /// serviceId like ResourceService, DrawingService etc.
- ///
- /// \return
- /// Nothing
- ///
- virtual void GetOperationHeader(MgOperationPacket& operPacket);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the response header from the server
- ///
- /// \param packetHeader
- /// Outparameter , packet header received.
- ///
- virtual void GetOperationResponseHeader(MgOperationResponsePacket& mop);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the header from the server
- ///
- virtual void GetArgumentHeader(MgArgumentPacket& map);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Gets the binary stream header from the server
- ///
- virtual void GetBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
/// This reads the stream from the server
///
/// \return
@@ -235,58 +194,9 @@
///
virtual MgObject* GetObject();
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the stream header
- ///
- /// \param msh
- /// Stream header to hold the data
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteStreamHeader(MgStreamHeader& msh);
//////////////////////////////////////////////////////////////////
/// \brief
- /// This writes the operation header to the server
- ///
- /// \param operPacket
- /// Operation packet to write
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteOperationHeader(MgOperationPacket& operPacket);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the stream header to the server
- ///
- virtual MgStreamHelper::MgStreamStatus WriteBinaryStreamHeader(MgBinaryStreamArgumentPacket& bsap);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the response header from the server
- ///
- /// \param eCode
- /// eCode to send.
- /// \param retValues
- /// no. of return arguments .
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteOperationResponseHeader( MgOperationResponsePacket& mop );
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// Writes the header to the server
- ///
- virtual MgStreamHelper::MgStreamStatus WriteArgumentHeader(MgArgumentPacket& map);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
/// This writes the string argument packet to the server
///
/// \param value
@@ -381,73 +291,6 @@
///
virtual MgStreamHelper::MgStreamStatus WriteByte(BYTE value);
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the stream to the server
- ///
- /// \param byteReader
- /// ByteReader from which stream to be taken
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteStream(MgByteReader* byteReader);
-
- //////////////////////////////////////////////////////////////////
- /// \brief
- /// This writes the class id argument packet to the server
- ///
- /// \param value
- /// value to be written.
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteClassId(INT32 value);
-
- /// \brief
- /// Writes the end of stream header
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteStreamEnd();
-
- /// \brief
- /// Writes the Object to stream
- ///
- /// <param>
- /// ClassId of object to be sent
- /// </param>
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteObject(MgObject* obj);
-
- /// \brief
- /// Writes the Stream header and Operation header for version 1 stream
- ///
- /// \param eCode
- /// Code specifies whether it is success or failure or success with warnings
- /// \param noOfRetValues
- /// No of return values being sent
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteResponseHeader(MgPacketParser::MgECode eCode, UINT32 noOfRetValues);
-
- /// \brief
- /// Writes stream header, control packet, and stream end to the stream
- ///
- /// \param packet
- /// Control packet to write to stream
- ///
- /// \return
- /// Stream status
- ///
- virtual MgStreamHelper::MgStreamStatus WriteControlPacket(MgControlPacket& packet);
};
/// \endcond
Modified: sandbox/adsk/vik/Common/Geometry/Buffer/MgBuffer.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Buffer/MgBuffer.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Buffer/MgBuffer.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -181,8 +181,7 @@
arguments.Add(L"2");
arguments.Add(buffer);
- throw new MgException(L"MgBuffer.BufferGeometry",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryType", NULL);
+ throw new MgException(L"MgInvalidGeometryType");
}
}
}
Modified: sandbox/adsk/vik/Common/Geometry/Buffer/oobject.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Buffer/oobject.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Buffer/oobject.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -88,7 +88,7 @@
void *newMemPtr = ::realloc(memPtr, nBytes);
if (!newMemPtr && nBytes != 0)
{
- throw new MgException(L"OpsObject.ReallocMem", __LINE__, __WFILE__, NULL, L"OutOfMemory", NULL);
+ throw new MgException(L"OutOfMemory");
}
return newMemPtr;
Modified: sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemCache.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemCache.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemCache.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -90,8 +90,7 @@
{
if (key.empty() || NULL == value)
{
- throw new MgException(L"MgCoordinateSystemCache.Set",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgLock lock(m_mutex);
@@ -118,8 +117,7 @@
{
if (key.empty())
{
- throw new MgException(L"MgCoordinateSystemCache.Get",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
MgLock lock(m_mutex);
Modified: sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/CoordinateSystem/CoordinateSystemFactory.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -98,9 +98,7 @@
if (NULL == sm_pCatalog)
{
- throw new MgException(
- L"MgCoordinateSystemFactory.Create",
- __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
MgCoordinateSystemCache* coordinateSystemCache = MgCoordinateSystemCache::GetInstance();
@@ -132,9 +130,7 @@
if (NULL == sm_pCatalog)
{
- throw new MgException(
- L"MgCoordinateSystemFactory.CreateFromCode",
- __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
MgCoordinateSystemCache* coordinateSystemCache = MgCoordinateSystemCache::GetInstance();
@@ -185,7 +181,7 @@
{
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.GetCatalog", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return SAFE_ADDREF((MgCoordinateSystemCatalog*)sm_pCatalog);
@@ -219,12 +215,12 @@
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertWktToCoordinateSystemCode", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
if (!pConverter)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertWktToCoordinateSystemCode", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
code=pConverter->WktToCode(MgCoordinateSystemWktFlavor::Unknown, wkt, MgCoordinateSystemCodeFormat::Mentor);
@@ -248,12 +244,12 @@
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertCoordinateSystemCodeToWkt", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
if (!pConverter)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertCoordinateSystemCodeToWkt", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
// Check to see if this is an EPSG code. ie: "EPSG:4326"
@@ -288,12 +284,12 @@
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.ToString", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemCategoryDictionary> pCtDict=sm_pCatalog->GetCategoryDictionary();
if (!pCtDict)
{
- throw new MgException(L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoCategoryDictionaryException");
}
Ptr<MgCoordinateSystemEnum> pEnum=pCtDict->GetEnum();
@@ -301,7 +297,7 @@
categoryNames=pEnum->NextName(nNbCategories);
if (categoryNames->GetCount()!=nNbCategories)
{
- throw new MgException(L"MgCoordinateSystemFactory.EnumerateCategories", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
return categoryNames.Detach();
@@ -326,22 +322,22 @@
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemCategoryDictionary> pCtDict=sm_pCatalog->GetCategoryDictionary();
if (!pCtDict)
{
- throw new MgException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoCategoryDictionaryException");
}
Ptr<MgCoordinateSystemCategory> pCategory=pCtDict->GetCategory(category);
if (!pCategory)
{
- throw new MgException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"MgCoordinateSystemNoCategoryInDictionaryException", NULL);
+ throw new MgException(L"MgCoordinateSystemNoCategoryInDictionaryException");
}
Ptr<MgCoordinateSystemEnum> pEnum=pCategory->GetEnum();
if (!pEnum)
{
- throw new MgException(L"MgCoordinateSystemFactory.EnumerateCoordinateSystems", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
for ( ; ; )
@@ -414,12 +410,12 @@
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertEpsgCodeToWkt", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
if (!pConverter)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertEpsgCodeToWkt", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
wchar_t wszEpsg[255];
#ifdef _WIN32
@@ -450,12 +446,12 @@
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
if (!pConverter)
{
- throw new MgException(L"MgCoordinateSystemFactory.ConvertWktToEpsgCode", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
STRING strEpsgCode=pConverter->WktToCode(MgCoordinateSystemWktFlavor::Unknown, wkt, MgCoordinateSystemCodeFormat::Epsg);
nEpsg = (INT32)wcstol(strEpsgCode.c_str(), NULL, 10);
@@ -481,13 +477,13 @@
{
if (!sm_pCatalog)
{
- throw new MgException(L"MgCoordinateSystemFactory.IsValid", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
Ptr<MgCoordinateSystemFormatConverter> pConverter=sm_pCatalog->GetFormatConverter();
if (!pConverter)
{
- throw new MgException(L"MgCoordinateSystemFactory.IsValid", __LINE__, __WFILE__, NULL, L"CoordinateSystemInitializationFailed", NULL);
+ throw new MgException(L"CoordinateSystemInitializationFailed");
}
try
@@ -534,7 +530,7 @@
// Check the consistency of all these parameters.
if (!gridSpecification->IsConsistent ())
{
- throw new MgException(L"MgCoordinateSystemFactory.GridSpecification", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
}
Modified: sandbox/adsk/vik/Common/Geometry/CurvePolygon.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/CurvePolygon.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/CurvePolygon.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -60,7 +60,7 @@
MgCurveRing* MgCurvePolygon::GetInteriorRing(INT32 index)
{
if (m_innerRings == NULL)
- throw new MgException(L"MgCurvePolygon.GetInteriorRing", __LINE__, __WFILE__, NULL, L"ArgumentOutOfRange", NULL);
+ throw new MgException(L"ArgumentOutOfRange");
return m_innerRings->GetItem(index);
}
Modified: sandbox/adsk/vik/Common/Geometry/CurveString.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/CurveString.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/CurveString.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -28,12 +28,7 @@
if(curveSegments->GetCount() == 0)
{
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(L"0");
-
- throw new MgException(L"MgCurveString.MgCurveString",
- __LINE__, __WFILE__, &arguments, L"MgGeometryEmpty", NULL);
+ throw new MgException(L"MgGeometryEmpty");
}
m_segments = curveSegments->Copy();
Modified: sandbox/adsk/vik/Common/Geometry/Envelope.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Envelope.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Envelope.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -49,18 +49,7 @@
if (coord1->GetDimension() != coord2->GetDimension())
{
- STRING buffer;
- MgStringCollection arguments;
-
- MgUtil::Int32ToString(coord1->GetDimension(), buffer);
- arguments.Add(L"1");
- arguments.Add(buffer);
- MgUtil::Int32ToString(coord2->GetDimension(), buffer);
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgEnvelope.MgEnvelope",
- __LINE__, __WFILE__, &arguments, L"MgCoordinateDimensionDifferent", NULL);
+ throw new MgException(L"MgCoordinateDimensionDifferent");
}
if (coord1->GetX() < coord2->GetX())
@@ -68,18 +57,7 @@
// coord1 is lower left
if (coord1->GetY() > coord2->GetY())
{
- STRING buffer;
- MgStringCollection arguments;
-
- MgUtil::DoubleToString(coord1->GetY(), buffer);
- arguments.Add(L"1");
- arguments.Add(buffer);
- MgUtil::DoubleToString(coord2->GetY(), buffer);
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgEnvelope.MgEnvelope",
- __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
+ throw new MgException(L"MgInvalidEnvelopeCoordinates");
}
m_lowerLeft = SAFE_ADDREF(coord1);
@@ -90,18 +68,7 @@
// coord2 is lower left
if (coord2->GetY() > coord1->GetY())
{
- STRING buffer;
- MgStringCollection arguments;
-
- MgUtil::DoubleToString(coord1->GetY(), buffer);
- arguments.Add(L"1");
- arguments.Add(buffer);
- MgUtil::DoubleToString(coord2->GetY(), buffer);
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgEnvelope.MgEnvelope",
- __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
+ throw new MgException(L"MgInvalidEnvelopeCoordinates");
}
m_lowerLeft = SAFE_ADDREF(coord2);
@@ -129,34 +96,12 @@
{
if (xMin > xMax)
{
- STRING buffer;
- MgStringCollection arguments;
-
- MgUtil::DoubleToString(xMin, buffer);
- arguments.Add(L"1");
- arguments.Add(buffer);
- MgUtil::DoubleToString(xMax, buffer);
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgEnvelope.MgEnvelope",
- __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
+ throw new MgException(L"MgInvalidEnvelopeCoordinates");
}
if (yMin > yMax)
{
- STRING buffer;
- MgStringCollection arguments;
-
- MgUtil::DoubleToString(yMin, buffer);
- arguments.Add(L"1");
- arguments.Add(buffer);
- MgUtil::DoubleToString(yMax, buffer);
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgEnvelope.MgEnvelope",
- __LINE__, __WFILE__, &arguments, L"MgInvalidEnvelopeCoordinates", NULL);
+ throw new MgException(L"MgInvalidEnvelopeCoordinates");
}
m_lowerLeft = new MgCoordinateXY(xMin, yMin);
Modified: sandbox/adsk/vik/Common/Geometry/GeometricEntity.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/GeometricEntity.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/GeometricEntity.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -31,7 +31,7 @@
//
MgGeometricPathIterator* MgGeometricEntity::GetPath()
{
- throw new MgException(L"MgGeometricEntityImpl.GetPath", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
}
//////////////////////////////////////////////////////////////////
Modified: sandbox/adsk/vik/Common/Geometry/Geometry.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Geometry.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Geometry.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -228,15 +228,7 @@
{
if (distance == 0.0)
{
- STRING buffer;
- MgUtil::DoubleToString(distance, buffer);
-
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgGeometry.Buffer",
- __LINE__, __WFILE__, &arguments, L"MgValueCannotBeZero", NULL);
+ throw new MgException(L"MgValueCannotBeZero: distance");
}
MgBuffer buffer;
Modified: sandbox/adsk/vik/Common/Geometry/LineString.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/LineString.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/LineString.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -31,12 +31,7 @@
STRING buffer;
MgUtil::Int32ToString(coordinates->GetCount(), buffer);
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgLineString.MgLineString",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryTooFewCoordinates", NULL);
+ throw new MgException(L"MgInvalidGeometryTooFewCoordinates: " + buffer);
}
m_coordinates = coordinates->Copy();
Modified: sandbox/adsk/vik/Common/Geometry/LinearRing.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/LinearRing.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/LinearRing.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -29,12 +29,7 @@
STRING buffer;
MgUtil::Int32ToString(coordinates->GetCount(), buffer);
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgLinearRing.MgLinearRing",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryTooFewCoordinates", NULL);
+ throw new MgException(L"MgInvalidGeometryTooFewCoordinates: " + buffer);
}
m_coordinates = coordinates->Copy();
@@ -161,7 +156,7 @@
{
//should not be called on geometry components
//components are serialized by the containing geometries
- throw new MgException(L"MgLinearRing.Serialize", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
}
//////////////////////////////////////////////////////////////////
@@ -171,7 +166,7 @@
{
//should not be called on geometry components
//components are deserialized by the containing geometries
- throw new MgException(L"MgLinearRing.Deserialize", __LINE__, __WFILE__, NULL, L"NotImplemented", NULL);
+ throw new MgException(L"NotImplemented");
}
///////////////////////////////////////////////////////////////////////////
Modified: sandbox/adsk/vik/Common/Geometry/LinearSegment.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/LinearSegment.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/LinearSegment.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -34,8 +34,7 @@
arguments.Add(L"1");
arguments.Add(buffer);
- throw new MgException(L"MgLinearSegment.MgLinearSegment",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryTooFewCoordinates", NULL);
+ throw new MgException(L"MgInvalidGeometryTooFewCoordinates: " + buffer);
}
m_coordinates = coordinates->Copy();
Modified: sandbox/adsk/vik/Common/Geometry/Parse/Array.h
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Parse/Array.h 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Parse/Array.h 2011-12-08 20:58:31 UTC (rev 6322)
@@ -324,7 +324,7 @@
{
if (i >= GetCount() || i < 0)
{
- throw new MgIndexOutOfRangeException(L"GisArray<T>.GetValue", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"IndexOutOfRange");
}
return *(this->GetData()+i);
@@ -335,7 +335,7 @@
T& GisArray<T>::GetValue(INT32 i)
{
if (i >= GetCount() || i < 0)
- throw new MgException(L"GisArray<T>.GetValue", __LINE__, __WFILE__, NULL, L"IndexOutOfRange", NULL);
+ throw new MgException(L"IndexOutOfRange");
return *(this->GetData()+i);
}
@@ -345,7 +345,7 @@
void GisArray<T>::SetValue(INT32 i, T newElement)
{
if (i >= GetCount() || i < 0)
- throw new MgIndexOutOfRangeException(L"GisArray<T>.SetValue", __LINE__, __WFILE__, NULL, L"", NULL);
+ throw new MgException(L"IndexOutOfRange");
*(this->GetData()+i) = newElement;
}
Modified: sandbox/adsk/vik/Common/Geometry/Parse/ArrayHelper.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Parse/ArrayHelper.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Parse/ArrayHelper.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -27,7 +27,7 @@
{
// Disallow possible re-allocation if object is shared.
if (array->m_metadata.refCount > 1)
- throw new MgException(L"GisArrayHelper.Append", __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
if ( array->m_metadata.size + numElements > array->m_metadata.alloc )
array = AllocMore(array, numElements, false /*exactly*/, elementSize); // We could calculate the difference here, allocating less.
@@ -44,7 +44,7 @@
{
// Disallow possible re-allocation if object is shared.
if (array->m_metadata.refCount > 1)
- throw new MgException(L"GisArrayHelper.SetSize", __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
if ( numElements > array->m_metadata.alloc )
{
@@ -67,10 +67,10 @@
{
// Disallow possible re-allocation if object is shared.
if (array->m_metadata.refCount > 1)
- throw new MgException(L"GisArrayHelper.SetAlloc", __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
if (numElements < array->m_metadata.size || numElements < MIN_ALLOC)
- throw new MgException(L"GisArrayHelper.SetAlloc", __LINE__, __WFILE__, NULL, L"InvalidOperation", NULL);
+ throw new MgException(L"InvalidOperation");
if (array->m_metadata.alloc != numElements)
{
Modified: sandbox/adsk/vik/Common/Geometry/Parse/LexAwkt.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Parse/LexAwkt.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Parse/LexAwkt.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -321,7 +321,7 @@
if (!iswdigit(m_ch))
{
// Exponent shall contain digits
- throw new MgException(L"GisLexAwkt.getnumber", __LINE__, __WFILE__, NULL, L"NotFiniteNumber", NULL);
+ throw new MgException(L"NotFiniteNumber");
}
pstr = getdigits(pstr);
*pstr = CHR_NULL;
Modified: sandbox/adsk/vik/Common/Geometry/Parse/ParseAwkt.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Parse/ParseAwkt.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Parse/ParseAwkt.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -81,7 +81,7 @@
if (NULL == pwzAwkt)
{
- throw new MgException(L"MgParseAwkt.ParseAwkt", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
m_lex = new GisLexAwkt(pwzAwkt);
@@ -97,8 +97,7 @@
arguments.Add(L"1");
arguments.Add(pwzAwkt);
- throw new MgException(L"MgParseAwkt.ParseAwkt",
- __LINE__, __WFILE__, &arguments, L"MgInvalidAgfText", NULL);
+ throw new MgException(L"MgInvalidAgfText");
}
return SAFE_ADDREF(m_geometry.p);
@@ -547,7 +546,7 @@
m_types->GetCount() != m_dims->GetCount() ||
m_types->GetCount() != m_starts->GetCount())
{
- throw new MgException(L"MgParseAwkt.ParseAwkt", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
_types type = (_types) (*m_types)[0];
@@ -616,12 +615,7 @@
STRING buffer;
MgUtil::Int32ToString(iToken, buffer);
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgParseAwkt.SetGeometryType",
- __LINE__, __WFILE__, &arguments, L"MgInvalidAgfText", NULL);
+ throw new MgException(L"MgInvalidAgfText: " + buffer);
}
break;
}
@@ -802,13 +796,7 @@
{
STRING buffer;
MgUtil::Int32ToString(m_dim, buffer);
-
- MgStringCollection arguments;
- arguments.Add(L"0");
- arguments.Add(buffer);
-
- throw new MgException(L"MgParseAwkt.ParseAwkt",
- __LINE__, __WFILE__, &arguments, L"MgInvalidAgfText", NULL);
+ throw new MgException(L"MgInvalidAgfText: " + buffer);
}
break;
}
Modified: sandbox/adsk/vik/Common/Geometry/Parse/ParseAwktUtil.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Parse/ParseAwktUtil.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Parse/ParseAwktUtil.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -63,7 +63,7 @@
if (ordinates == NULL)
{
- throw new MgException(L"MgParseAwktUtil.CreateCoordinateCollection", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
Ptr<MgCoordinateCollection> coordCol = new MgCoordinateCollection();
Modified: sandbox/adsk/vik/Common/Geometry/Polygon.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Polygon.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Polygon.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -60,7 +60,7 @@
MgLinearRing* MgPolygon::GetInteriorRing(INT32 index)
{
if (m_innerRings == NULL)
- throw new MgException(L"MgPolygon.GetInteriorRing", __LINE__, __WFILE__, NULL, L"ArgumentOutOfRange", NULL);
+ throw new MgException(L"ArgumentOutOfRange");
return m_innerRings->GetItem(index);
}
Modified: sandbox/adsk/vik/Common/Geometry/Spatial/MathUtility.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Spatial/MathUtility.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Spatial/MathUtility.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -79,7 +79,7 @@
// initialize static vars
if (a == NULL || eindex == NULL)
- throw new MgException(L"GisMathUtility.LUDecompose", __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
if (n <= 0)
{
@@ -90,8 +90,7 @@
arguments.Add(L"1");
arguments.Add(buffer);
- throw new MgException(L"GisMathUtility.LUDecompose",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryNoDimension", NULL);
+ throw new MgException(L"MgInvalidGeometryNoDimension");
}
dim = n;
@@ -185,8 +184,7 @@
arguments.Add(L"3");
arguments.Add(buffer);
- throw new MgException(L"GisMathUtility.LUDecompose",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryBadProportion", NULL);
+ throw new MgException(L"MgInvalidGeometryBadProportion");
}
if (SnapToZero(fabs(end-start)) == 0.0)
Modified: sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtility.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtility.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtility.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -49,8 +49,7 @@
if ( geometry == NULL )
{
- throw new MgException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
- __LINE__, __WFILE__, NULL, L"NullArgument", NULL);
+ throw new MgException(L"NullArgument");
}
if ( maxSpacing < 0.0 )
@@ -58,12 +57,7 @@
STRING buffer;
MgUtil::DoubleToString(maxSpacing, buffer);
- MgStringCollection arguments;
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
- __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
+ throw new MgException(L"MgValueCannotBeLessThanZero: " + buffer);
}
if ( maxOffset < 0.0 )
@@ -71,12 +65,7 @@
STRING buffer;
MgUtil::DoubleToString(maxOffset, buffer);
- MgStringCollection arguments;
- arguments.Add(L"3");
- arguments.Add(buffer);
-
- throw new MgException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
- __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
+ throw new MgException(L"MgValueCannotBeLessThanZero: " + buffer);
}
INT32 geomType = geometry->GetGeometryType();
@@ -170,12 +159,7 @@
STRING buffer;
MgUtil::Int32ToString(geomType, buffer);
- MgStringCollection arguments;
- arguments.Add(L"1");
- arguments.Add(buffer);
-
- throw new MgException(L"MgSpatialUtility.ApproximateGeometryWithLineStrings",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryType", NULL);
+ throw new MgException(L"MgInvalidGeometryType: " + buffer);
}
}
@@ -247,12 +231,7 @@
STRING buffer;
MgUtil::Int32ToString(gct, buffer);
- MgStringCollection arguments;
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgSpatialUtility.AppendLinearizedCurveSegmentsToDistinctCollection",
- __LINE__, __WFILE__, &arguments, L"MgInvalidGeometryComponentType", NULL);
+ throw new MgException(L"MgInvalidGeometryComponentType: " + buffer);
}
}
}
@@ -562,7 +541,7 @@
CHECKNULL(seg2To, L"MgSpatialUtility.SegmentIntersection")
if (magnitude < 1.0E-04)
{
- throw new MgException(L"MgSpatialUtility.SegmentIntersection", __LINE__, __WFILE__, NULL, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument");
}
// Compute a tolerance which is appropriate for the data we are working
Modified: sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp
===================================================================
--- sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp 2011-12-08 18:26:31 UTC (rev 6321)
+++ sandbox/adsk/vik/Common/Geometry/Spatial/SpatialUtilityCircularArc.cpp 2011-12-08 20:58:31 UTC (rev 6322)
@@ -339,7 +339,7 @@
if (MgMathUtility::LUDecompose(3, a, eindex ) == 0)
{
// Zero result means that points were collinear.
- throw new MgException(L"MgSpatialUtilityCircularArc.ComputeCenterFromThreePositions", __LINE__, __WFILE__, NULL, L"CollinearPoints", NULL);
+ throw new MgException(L"CollinearPoints");
}
/* Perform row exchanges for b */
@@ -384,12 +384,7 @@
STRING buffer;
MgUtil::DoubleToString(maxSpacing, buffer);
- MgStringCollection arguments;
- arguments.Add(L"2");
- arguments.Add(buffer);
-
- throw new MgException(L"MgSpatialUtilityCircularArc.Linearize",
- __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
+ throw new MgException(L"MgValueCannotBeLessThanZero: " + buffer);
}
if (maxOffset < 0.0)
@@ -397,12 +392,7 @@
STRING buffer;
MgUtil::DoubleToString(maxOffset, buffer);
- MgStringCollection arguments;
- arguments.Add(L"3");
- arguments.Add(buffer);
-
- throw new MgException(L"MgSpatialUtilityCircularArc.Linearize",
- __LINE__, __WFILE__, &arguments, L"MgValueCannotBeLessThanZero", NULL);
+ throw new MgException(L"MgValueCannotBeLessThanZero: " + buffer);
}
// Avoid mathematical exceptions later.
@@ -538,9 +528,7 @@
STRING buffer;
MgUtil::DoubleToString(radius, buffer);
- MgStringCollection arguments;
- arguments.Add(buffer);
- throw new MgException(L"MgSpatialUtilityCircularArc.BestArcStep", __LINE__, __WFILE__, &arguments, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument: " + buffer);
}
if (MgMathUtility::SnapToZero(maximumError) <= 0.0)
@@ -548,9 +536,7 @@
STRING buffer;
MgUtil::DoubleToString(maximumError, buffer);
- MgStringCollection arguments;
- arguments.Add(buffer);
- throw new MgException(L"MgSpatialUtilityCircularArc.BestArcStep", __LINE__, __WFILE__, &arguments, L"InvalidArgument", NULL);
+ throw new MgException(L"InvalidArgument: " + buffer);
}
double arcStep = 0.0;
More information about the mapguide-commits
mailing list