Commit 037d422e authored by Antoine Regimbeau's avatar Antoine Regimbeau

REFAC: take Luc comments into account : const& for vector

parent 4d5c8ce8
......@@ -164,7 +164,7 @@ public:
* \note No condition is assumed on the non-nullity of \c source.
* \see \c DataSource(GDALDataset *)
*/
static Pointer New(ogr::version_proxy::GDALDatasetType * sourcemode, Modes::type mode = Modes::Read , std::vector< std::string > layerOptions = std::vector< std::string >() );
static Pointer New(ogr::version_proxy::GDALDatasetType * sourcemode, Modes::type mode = Modes::Read , const std::vector< std::string > & layerOptions = std::vector< std::string >() );
//@}
/**\name Projection Reference property */
......@@ -499,9 +499,9 @@ public:
*/
ogr::version_proxy::GDALDatasetType & ogr();
void SetLayerCreationOptions( std::vector< std::string > options );
void SetLayerCreationOptions( const std::vector< std::string > & options );
void AddLayerCreationOptions( std::vector< std::string > options );
std::vector< std::string > GetLayerCreationOptions();
const std::vector< std::string > & GetLayerCreationOptions() const ;
protected:
/** Default constructor.
......@@ -517,7 +517,7 @@ protected:
/** Init constructor.
* \post The newly constructed object owns the \c source parameter.
*/
DataSource(ogr::version_proxy::GDALDatasetType * source, Modes::type mode , std::vector< std::string > layerOption = std::vector< std::string >() );
DataSource(ogr::version_proxy::GDALDatasetType * source, Modes::type mode , const std::vector< std::string > & layerOption = std::vector< std::string >() );
/** Destructor.
* \post The \c GDALDataset owned is released (if not null).
*/
......
......@@ -137,7 +137,7 @@ otb::ogr::DataSource::DataSource()
otb::ogr::DataSource::DataSource(
otb::ogr::version_proxy::GDALDatasetType * source ,
Modes::type mode ,
std::vector< std::string > options /*NULL*/ )
const std::vector< std::string > & options /*NULL*/ )
: m_DataSource(source) ,
m_LayerOptions(options) ,
m_OpenMode(mode) ,
......@@ -244,7 +244,7 @@ otb::ogr::DataSource::New(std::string const& datasourceName, Modes::type mode)
/*static*/
otb::ogr::DataSource::Pointer
otb::ogr::DataSource::New(otb::ogr::version_proxy::GDALDatasetType * source , Modes::type mode , std::vector< std::string > layerOptions )
otb::ogr::DataSource::New(otb::ogr::version_proxy::GDALDatasetType * source , Modes::type mode , const std::vector< std::string > & layerOptions )
{
Pointer res = new DataSource( source , mode , layerOptions );
res->UnRegister();
......@@ -620,7 +620,7 @@ otb::ogr::Layer otb::ogr::DataSource::ExecuteSQL(
void
otb::ogr::DataSource::
SetLayerCreationOptions( std::vector< std::string > options )
SetLayerCreationOptions( const std::vector< std::string > & options )
{
FileNameHelperType::Pointer helper = FileNameHelperType::New();
helper->SetGDALLayerOptions( options );
......@@ -639,9 +639,9 @@ AddLayerCreationOptions( std::vector< std::string > options )
// perf : do we move code from helper->AddGDALLayerOptions in here?
}
std::vector< std::string >
const std::vector< std::string > &
otb::ogr::DataSource::
GetLayerCreationOptions()
GetLayerCreationOptions() const
{
return m_LayerOptions;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment