[mapguide-commits] r1260 - trunk/MgDev/Server/src/Services/Mapping
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Mar 16 14:08:50 EDT 2007
Author: waltweltonlair
Date: 2007-03-16 14:08:50 -0400 (Fri, 16 Mar 2007)
New Revision: 1260
Modified:
trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp
trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.h
Log:
Fixed a bug in RSMgFeatureReader - the wrong class name was being used in Reset().
Modified: trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp 2007-03-16 18:08:15 UTC (rev 1259)
+++ trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.cpp 2007-03-16 18:08:50 UTC (rev 1260)
@@ -27,9 +27,9 @@
//MgExceptions so it can't properly release them
#define RSFR_TRY() try {
#define RSFR_CATCH() } \
- catch (MgException* awe) \
+ catch (MgException* ex) \
{ \
- awe->Release(); \
+ ex->Release(); \
throw FdoException::Create();\
}
@@ -37,8 +37,7 @@
RSMgFeatureReader::RSMgFeatureReader(MgFeatureReader* reader, MgFeatureService* svcFeature, MgResourceIdentifier* featResId, MgFeatureQueryOptions* options, const STRING& geomPropName)
{
assert(NULL != reader);
- m_reader = reader;
- SAFE_ADDREF(m_reader);
+ m_reader = SAFE_ADDREF(reader);
//stuff needed for resetting the reader
m_svcFeature = SAFE_ADDREF(svcFeature);
@@ -58,10 +57,8 @@
Ptr<MgPropertyDefinitionCollection> pdc = m_class->GetPropertiesIncludingBase();
//
- //
// Set up the cache of propery data types and indices
//
- //
m_numProps = pdc->GetCount();
m_vProps = new PropertyStub[m_numProps];
@@ -134,9 +131,9 @@
//otherwise we will use the geometry proeprty
if (m_rasterPropName == geomPropName)
m_geomPropName = L"";
-
}
+
RSMgFeatureReader::~RSMgFeatureReader()
{
m_reader->Close();
@@ -152,6 +149,7 @@
delete [] m_idpropNames;
}
+
bool RSMgFeatureReader::ReadNext()
{
RSFR_TRY()
@@ -159,6 +157,7 @@
RSFR_CATCH()
}
+
void RSMgFeatureReader::Close()
{
RSFR_TRY()
@@ -166,6 +165,7 @@
RSFR_CATCH()
}
+
void RSMgFeatureReader::Reset()
{
RSFR_TRY()
@@ -173,11 +173,12 @@
m_reader->Close();
SAFE_RELEASE(m_reader);
- m_reader = m_svcFeature->SelectFeatures(m_resId, m_class->GetClassName(), m_options);
+ m_reader = m_svcFeature->SelectFeatures(m_resId, m_class->GetName(), m_options);
RSFR_CATCH()
}
+
bool RSMgFeatureReader::IsNull(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -185,6 +186,7 @@
RSFR_CATCH()
}
+
bool RSMgFeatureReader::GetBoolean(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -192,6 +194,7 @@
RSFR_CATCH()
}
+
unsigned char RSMgFeatureReader::GetByte(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -199,6 +202,7 @@
RSFR_CATCH()
}
+
FdoDateTime RSMgFeatureReader::GetDateTime(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -218,6 +222,7 @@
RSFR_CATCH()
}
+
float RSMgFeatureReader::GetSingle(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -225,6 +230,7 @@
RSFR_CATCH()
}
+
double RSMgFeatureReader::GetDouble(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -232,6 +238,7 @@
RSFR_CATCH()
}
+
short RSMgFeatureReader::GetInt16(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -239,6 +246,7 @@
RSFR_CATCH()
}
+
int RSMgFeatureReader::GetInt32(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -246,6 +254,7 @@
RSFR_CATCH()
}
+
long long RSMgFeatureReader::GetInt64(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -253,6 +262,7 @@
RSFR_CATCH()
}
+
const wchar_t* RSMgFeatureReader::GetString(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -261,6 +271,7 @@
RSFR_CATCH()
}
+
LineBuffer* RSMgFeatureReader::GetGeometry(const wchar_t* propertyName,
LineBuffer* lb,
CSysTransformer* xformer)
@@ -282,6 +293,7 @@
RSFR_CATCH()
}
+
RS_Raster* RSMgFeatureReader::GetRaster(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -290,6 +302,7 @@
RSFR_CATCH()
}
+
RS_InputStream* RSMgFeatureReader::GetBLOB(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -298,6 +311,7 @@
RSFR_CATCH()
}
+
RS_InputStream* RSMgFeatureReader::GetCLOB(const wchar_t* propertyName)
{
RSFR_TRY()
@@ -363,6 +377,7 @@
return 0;
}
+
const wchar_t* RSMgFeatureReader::GetAsString(const wchar_t* propertyName)
{
static const size_t MAX_STRING = 64;
@@ -462,6 +477,7 @@
return m_cachePropValue.c_str();
}
+
const wchar_t* RSMgFeatureReader::GetGeomPropName()
{
if (m_geomPropName.empty())
@@ -470,6 +486,7 @@
return m_geomPropName.c_str();
}
+
const wchar_t* RSMgFeatureReader::GetRasterPropName()
{
//The Mapping service will add this computed property
@@ -481,12 +498,14 @@
//return m_rasterPropName;
}
+
const wchar_t*const* RSMgFeatureReader::GetIdentPropNames(int& count)
{
count = m_numIdProps;
return m_idpropNames;
}
+
const wchar_t*const* RSMgFeatureReader::GetPropNames(int& count)
{
count = m_numProps;
Modified: trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.h
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.h 2007-03-16 18:08:15 UTC (rev 1259)
+++ trunk/MgDev/Server/src/Services/Mapping/RSMgFeatureReader.h 2007-03-16 18:08:50 UTC (rev 1260)
@@ -44,54 +44,32 @@
// RS_FeatureReader implementation
//--------------------------------------------
- virtual bool ReadNext ();
+ virtual bool ReadNext();
+ virtual void Close ();
+ virtual void Reset ();
- virtual void Close ();
-
- virtual void Reset ();
-
+ virtual bool IsNull (const wchar_t* propertyName);
+ virtual bool GetBoolean (const wchar_t* propertyName);
+ virtual unsigned char GetByte (const wchar_t* propertyName);
+ virtual FdoDateTime GetDateTime (const wchar_t* propertyName);
+ virtual float GetSingle (const wchar_t* propertyName);
+ virtual double GetDouble (const wchar_t* propertyName);
+ virtual short GetInt16 (const wchar_t* propertyName);
+ virtual int GetInt32 (const wchar_t* propertyName);
+ virtual long long GetInt64 (const wchar_t* propertyName);
+ virtual const wchar_t* GetString (const wchar_t* propertyName);
+ virtual LineBuffer* GetGeometry (const wchar_t* propertyName, LineBuffer* lb, CSysTransformer* xformer);
+ virtual RS_Raster* GetRaster (const wchar_t* propertyName);
+ virtual const wchar_t* GetAsString (const wchar_t* propertyName);
+ virtual RS_InputStream* GetBLOB (const wchar_t* propertyName);
+ virtual RS_InputStream* GetCLOB (const wchar_t* propertyName);
virtual int GetPropertyType(const wchar_t* propertyName);
- virtual bool IsNull (const wchar_t* propertyName);
+ virtual const wchar_t* GetGeomPropName ();
+ virtual const wchar_t* GetRasterPropName();
+ virtual const wchar_t* const* GetIdentPropNames(int& count);
+ virtual const wchar_t* const* GetPropNames (int& count);
- virtual bool GetBoolean (const wchar_t* propertyName);
-
- virtual unsigned char GetByte (const wchar_t* propertyName);
-
- virtual FdoDateTime GetDateTime (const wchar_t* propertyName);
-
- virtual float GetSingle (const wchar_t* propertyName);
-
- virtual double GetDouble (const wchar_t* propertyName);
-
- virtual short GetInt16 (const wchar_t* propertyName);
-
- virtual int GetInt32 (const wchar_t* propertyName);
-
- virtual long long GetInt64 (const wchar_t* propertyName);
-
- virtual const wchar_t* GetString (const wchar_t* propertyName);
-
- virtual LineBuffer* GetGeometry (const wchar_t* propertyName,
- LineBuffer* lb,
- CSysTransformer* xformer);
-
- virtual RS_Raster* GetRaster (const wchar_t* propertyName);
-
- virtual RS_InputStream* GetBLOB (const wchar_t* propertyName);
-
- virtual RS_InputStream* GetCLOB (const wchar_t* propertyName);
-
- virtual const wchar_t* GetAsString (const wchar_t* propertyName);
-
- virtual const wchar_t* GetGeomPropName();
-
- virtual const wchar_t* GetRasterPropName();
-
- virtual const wchar_t*const* GetIdentPropNames(int& count);
-
- virtual const wchar_t*const* GetPropNames(int& count);
-
private:
MgFeatureReader* m_reader;
MgClassDefinition* m_class;
More information about the mapguide-commits
mailing list