Commit 568d37e3 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Port to gcc43. Remove workaround for bug #42574.

Modify all source code to complete the port to gcc43
(remove 'type qualifiers on function return type' warnings).
Use the automatic sedGcc43.csh script.


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@14960 4525493e-7705-40b1-a816-d608a930855b
parent f44d39e6
// $Id: CompositeSelection.h,v 1.5 2008-11-03 16:52:36 avalassi Exp $
// $Id: CompositeSelection.h,v 1.6 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_COMPOSITESELECTION_H
#define COOLKERNEL_COMPOSITESELECTION_H 1
......@@ -29,7 +29,7 @@ namespace cool
enum Connective{ AND, OR };
/// Describe a logical connective.
static const std::string describe( const Connective conn );
static const std::string describe( Connective conn );
public:
......@@ -39,37 +39,37 @@ namespace cool
/// Constructor for connecting two selections.
/// Each input selection is cloned (the clone is owned by this instance).
CompositeSelection( const IRecordSelection* sel1,
const Connective conn,
Connective conn,
const IRecordSelection* sel2 );
/// Constructor for connecting any number of selections.
/// The vector must contain at least two selections.
/// Each input selection is cloned (the clone is owned by this instance).
CompositeSelection( const Connective conn,
CompositeSelection( Connective conn,
const std::vector<const IRecordSelection*>& selVec );
/// Connect another selection.
/// The input selection is cloned (the clone is owned by this instance).
void connect( const Connective conn,
void connect( Connective conn,
const IRecordSelection* sel );
/// Can the selection be applied to a record with the given specification?
const bool canSelect( const IRecordSpecification& spec ) const;
bool canSelect( const IRecordSpecification& spec ) const;
/// Apply the selection to the given record.
const bool select( const IRecord& record ) const;
bool select( const IRecord& record ) const;
/// Clone the record selection (and any objects referenced therein).
IRecordSelection* clone() const;
/// Logical connective between all connected selections.
const Connective connective() const;
Connective connective() const;
/// The number N of connected selections.
const unsigned int size() const;
unsigned int size() const;
/// Return one of the connected selections by its index in [0, N-1].
const IRecordSelection* operator[] ( const unsigned int index ) const;
const IRecordSelection* operator[] ( unsigned int index ) const;
private:
......@@ -83,7 +83,7 @@ namespace cool
CompositeSelection& operator=( const CompositeSelection& rhs );
/// Constructor with a default connective and no selections - for connect()
CompositeSelection( const Connective conn );
CompositeSelection( Connective conn );
private:
......
// $Id: ConstRecordAdapter.h,v 1.20 2008-09-08 11:21:36 avalassi Exp $
// $Id: ConstRecordAdapter.h,v 1.21 2008-11-04 10:18:30 avalassi Exp $
#ifndef RELATIONALCOOL_CONSTRECORDADAPTER_H
#define RELATIONALCOOL_CONSTRECORDADAPTER_H 1
......@@ -49,7 +49,7 @@ namespace cool
const IField& operator[] ( const std::string& name ) const;
/// Return a field in this record by its index in [0, N-1] (const).
const IField& operator[] ( const UInt32 index ) const;
const IField& operator[] ( UInt32 index ) const;
/// Explicit conversion to a constant coral AttributeList reference.
/// The AttributeList returned by this method contains only the attributes
......@@ -60,10 +60,10 @@ namespace cool
private:
/// Return a field in this record by its index in [0, N-1] (const).
const IField& field( const UInt32 index ) const;
const IField& field( UInt32 index ) const;
/// This method THROWS an exception because this is a read-only class.
IField& field( const UInt32 index ); // THROWS...
IField& field( UInt32 index ); // THROWS...
private:
......
// $Id: FieldSelection.h,v 1.13 2008-11-03 16:52:36 avalassi Exp $
// $Id: FieldSelection.h,v 1.14 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_FIELDSELECTION_H
#define COOLKERNEL_FIELDSELECTION_H 1
......@@ -32,10 +32,10 @@ namespace cool
enum Nullness{ IS_NULL, IS_NOT_NULL };
/// Describe a binary relation operator.
static const std::string describe( const Relation relation );
static const std::string describe( Relation relation );
/// Describe a unary nullness operator.
static const std::string describe( const Nullness nullness );
static const std::string describe( Nullness nullness );
public:
......@@ -46,30 +46,30 @@ namespace cool
template<typename T>
FieldSelection( const std::string& name,
const StorageType::TypeId typeId,
const Relation relation,
Relation relation,
const T& refValue );
/// Constructor for comparison to NULL.
FieldSelection( const std::string& name,
const StorageType::TypeId typeId,
const Nullness nullness );
Nullness nullness );
/// Can the selection be applied to a record with the given specification?
const bool canSelect( const IRecordSpecification& spec ) const;
bool canSelect( const IRecordSpecification& spec ) const;
/// Apply the selection to the given record.
const bool select( const IRecord& record ) const;
bool select( const IRecord& record ) const;
/// Clone the record selection (and any objects referenced therein).
IRecordSelection* clone() const;
/// Nullness operator for this selection.
/// Returns IS_NOT_NULL for comparisons to non-NULL reference values.
const Nullness nullness() const;
Nullness nullness() const;
/// Relation operator for this selection.
/// Returns EQ or NE for comparisons to NULL reference values.
const Relation relation() const;
Relation relation() const;
/// Reference value for this selection.
/// Returns a NULL field for comparisons to NULL reference values.
......@@ -107,7 +107,7 @@ namespace cool
template<typename T>
inline FieldSelection::FieldSelection( const std::string& name,
const StorageType::TypeId typeId,
const Relation relation,
Relation relation,
const T& refValue )
: m_refValue( FieldSpecification( name, typeId ) )
, m_relation( relation )
......
// $Id: FieldSpecification.h,v 1.20 2008-07-29 09:07:43 avalassi Exp $
// $Id: FieldSpecification.h,v 1.21 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_FIELDSPECIFICATION_H
#define COOLKERNEL_FIELDSPECIFICATION_H 1
......@@ -29,10 +29,10 @@ namespace cool
const StorageType& storageType() const;
/// Compare the names and storage types of this and another field.
const bool operator==( const IFieldSpecification& rhs ) const;
bool operator==( const IFieldSpecification& rhs ) const;
/// Compare the names and storage types of this and another field.
const bool operator!=( const IFieldSpecification& rhs ) const;
bool operator!=( const IFieldSpecification& rhs ) const;
/// Check that a given field is compatible with this specification.
/// The field must have the same transient C++ type and a value
......@@ -43,7 +43,7 @@ namespace cool
/// Throw FieldSpecificationWrongStorageType if field has the wrong type.
/// Throw StorageTypeInvalidValue for values outside the allowed range.
void validate( const IField& field,
const bool checkName = true ) const;
bool checkName = true ) const;
/// Check that a given attribute is compatible with this specification.
/// The attribute must have the same transient C++ type and a value
......@@ -53,7 +53,7 @@ namespace cool
/// Throw StorageTypeWrongCppType if the attribute has the wrong C++ type.
/// Throw StorageTypeInvalidValue for values outside the allowed range.
void validate( const coral::Attribute& attribute,
const bool checkName = true ) const;
bool checkName = true ) const;
private:
......
......@@ -31,22 +31,22 @@ namespace cool
virtual ~FolderSpecification();
/// Constructor from versioning mode (payload specification has no fields).
FolderSpecification( const FolderVersioning::Mode
FolderSpecification( FolderVersioning::Mode
mode = FolderVersioning::SINGLE_VERSION );
/// Constructor from versioning mode and payload specification.
FolderSpecification( const FolderVersioning::Mode mode,
FolderSpecification( FolderVersioning::Mode mode,
const IRecordSpecification& payloadSpecification );
/*
/// Constructor from versioning mode and payload and channel specs.
FolderSpecification( const FolderVersioning::Mode mode,
FolderSpecification( FolderVersioning::Mode mode,
const IRecordSpecification& payloadSpecification,
const IRecordSpecification& channelSpecification );
*/
/// Get the versioning mode (const).
const FolderVersioning::Mode versioningMode() const;
FolderVersioning::Mode versioningMode() const;
/// Get the versioning mode (to modify it).
FolderVersioning::Mode versioningMode();
......
// $Id: IDatabase.h,v 1.84 2008-08-27 10:41:55 avalassi Exp $
// $Id: IDatabase.h,v 1.85 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IDATABASE_H
#define COOLKERNEL_IDATABASE_H 1
......@@ -45,13 +45,13 @@ namespace cool
/*
/// Does the database support this payload specification?
virtual const bool isValidPayloadSpecification
virtual bool isValidPayloadSpecification
( const IRecordSpecification& spec ) = 0;
*/
/*
/// Does the database support this channel specification?
virtual const bool isValidChannelSpecification
virtual bool isValidChannelSpecification
( const IRecordSpecification& spec ) = 0;
*/
......@@ -66,12 +66,12 @@ namespace cool
virtual IFolderSetPtr createFolderSet
( const std::string& fullPath,
const std::string& description = "",
const bool createParents = false ) = 0;
bool createParents = false ) = 0;
/// Does this folder set exist?
/// Throws DatabaseNotOpen if the database is not open.
/// Throws HvsPathHandlerException if the given path has an invalid format.
virtual const bool existsFolderSet( const std::string& folderSetName ) = 0;
virtual bool existsFolderSet( const std::string& folderSetName ) = 0;
/// Retrieve an existing folderset and return the corresponding manager.
/// The ownership of the folderset manager instance is shared.
......@@ -97,7 +97,7 @@ namespace cool
( const std::string& fullPath,
const IFolderSpecification& folderSpec,
const std::string& description = "",
const bool createParents = false ) = 0;
bool createParents = false ) = 0;
/// DEPRECATED: use IFolderSpecification instead of IRecordSpecification!
/// This is similar to the COOL1.3.3 API (with IRecordSpecification
......@@ -107,13 +107,13 @@ namespace cool
( const std::string& fullPath,
const IRecordSpecification& payloadSpec,
const std::string& description = "",
const FolderVersioning::Mode mode = FolderVersioning::SINGLE_VERSION,
const bool createParents = false ) = 0;
FolderVersioning::Mode mode = FolderVersioning::SINGLE_VERSION,
bool createParents = false ) = 0;
/// Does this folder exist?
/// Throws DatabaseNotOpen if the database is not open.
/// Throws HvsPathHandlerException if the given path has an invalid format.
virtual const bool existsFolder( const std::string& fullPath ) = 0;
virtual bool existsFolder( const std::string& fullPath ) = 0;
/// Retrieve an existing folder and return the corresponding manager.
/// The ownership of the folder manager instance is shared.
......@@ -125,7 +125,7 @@ namespace cool
/// Return the list of existing nodes
/// (in ascending/descending alphabetical order).
virtual const std::vector<std::string>
listAllNodes( const bool ascending = true ) = 0;
listAllNodes( bool ascending = true ) = 0;
/// Drop an existing node (folder or folder set).
/// Also delete any tags associated to the node.
......@@ -139,12 +139,12 @@ namespace cool
/// be dropped (i.e. continue to exist on exit from this method).
/// Throw an Exception if the node is a non-empty folder set.
/// Throw an Exception if any associated tags cannot be deleted.
virtual const bool dropNode( const std::string& fullPath ) = 0;
virtual bool dropNode( const std::string& fullPath ) = 0;
/// HVS: does this tag exist?
/// Tag names, except for "HEAD", are case sensitive.
/// Returns true for the reserved tags "" and "HEAD".
virtual const bool existsTag( const std::string& tagName ) const = 0;
virtual bool existsTag( const std::string& tagName ) const = 0;
/// HVS: return the node type (inner/leaf) where this tag name can be used.
/// Tag names, except for "HEAD", are case sensitive.
......@@ -160,7 +160,7 @@ namespace cool
taggedNodes( const std::string& tagName ) const = 0;
/// Is the database 'open'?
virtual const bool isOpen() const = 0;
virtual bool isOpen() const = 0;
/// (Re)opens the database.
virtual void openDatabase() = 0;
......
// $Id: IDatabaseSvc.h,v 1.35 2008-04-10 07:10:51 avalassi Exp $
// $Id: IDatabaseSvc.h,v 1.36 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IDATABASESVC_H
#define COOLKERNEL_IDATABASESVC_H 1
......@@ -52,7 +52,7 @@ namespace cool
/// supported by this COOL software release.
/// Throw DatabaseDoesNotExist if the database does not exist.
virtual IDatabasePtr openDatabase( const DatabaseId& dbId,
const bool readOnly = true ) const = 0;
bool readOnly = true ) const = 0;
/// Drop an existing database.
/// Return true if all database structures are dropped as expected.
......@@ -64,7 +64,7 @@ namespace cool
/// schema version supported by the current COOL software release.
/// Throw an Exception if the database or one of its structures
/// cannot be dropped (i.e. continues to exist on exit from this method).
virtual const bool dropDatabase( const DatabaseId& dbId ) const = 0;
virtual bool dropDatabase( const DatabaseId& dbId ) const = 0;
/// Retrieve the version number of the database service software.
virtual const std::string serviceVersion() const = 0;
......
// $Id: IField.h,v 1.49 2008-07-29 17:48:33 avalassi Exp $
// $Id: IField.h,v 1.50 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IFIELD_H
#define COOLKERNEL_IFIELD_H 1
......@@ -97,7 +97,7 @@ namespace cool
/// Is the value of this field null?
/// For strings, this is always false.
virtual const bool isNull() const = 0;
virtual bool isNull() const = 0;
/// Return the data value of this field (as true type).
/// Throw FieldWrongCppType if the field C++ type is not T.
......@@ -126,10 +126,10 @@ namespace cool
void setValue( const IField& field );
/// Compare the names, types and values of this and another field.
virtual const bool operator== ( const IField& rhs ) const;
virtual bool operator== ( const IField& rhs ) const;
/// Compare the names, types and values of this and another field.
virtual const bool operator!= ( const IField& rhs ) const;
virtual bool operator!= ( const IField& rhs ) const;
/// Print the name, storage type and data value of this field.
virtual std::ostream& print( std::ostream& os ) const;
......@@ -149,7 +149,7 @@ namespace cool
/// The values of two fields are equal either if they are both non null
/// and their true type values are equal, or if they are both null.
/// Private method - this does not check that fields have the same type.
virtual const bool compareValue( const IField& rhs ) const = 0;
virtual bool compareValue( const IField& rhs ) const = 0;
/// Set the value of this field to a well defined (non null) true-type.
/// For strings, setNull() is equivalent to setValue("").
......@@ -214,7 +214,7 @@ namespace cool
//--------------------------------------------------------------------------
inline const bool IField::operator==( const IField& rhs ) const
inline bool IField::operator==( const IField& rhs ) const
{
// Compare names, storage types and values
// (NB coral::Attribute::operator== does NOT compare names)
......@@ -224,7 +224,7 @@ namespace cool
//--------------------------------------------------------------------------
inline const bool IField::operator!=( const IField& rhs ) const
inline bool IField::operator!=( const IField& rhs ) const
{
return ( ! ( *this == rhs ) );
}
......
// $Id: IFieldSpecification.h,v 1.15 2006-12-14 09:51:51 avalassi Exp $
// $Id: IFieldSpecification.h,v 1.16 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IFIELDSPECIFICATION_H
#define COOLKERNEL_IFIELDSPECIFICATION_H 1
......@@ -65,10 +65,10 @@ namespace cool
virtual const StorageType& storageType() const = 0;
/// Compare the names and storage types of this and another field.
virtual const bool operator==( const IFieldSpecification& rhs ) const = 0;
virtual bool operator==( const IFieldSpecification& rhs ) const = 0;
/// Compare the names and storage types of this and another field.
virtual const bool operator!=( const IFieldSpecification& rhs ) const = 0;
virtual bool operator!=( const IFieldSpecification& rhs ) const = 0;
/// Check that a given field is compatible with this specification.
/// The field must have the same transient C++ type and a value
......@@ -79,7 +79,7 @@ namespace cool
/// Throw FieldSpecificationWrongStorageType if field has the wrong type.
/// Throw StorageTypeInvalidValue for values outside the allowed range.
virtual void validate( const IField& field,
const bool checkName = true ) const = 0;
bool checkName = true ) const = 0;
/// DEPRECATED - added for easier compatibility with COOL 1.3
/// (this is likely to be removed in a future COOL release).
......@@ -91,7 +91,7 @@ namespace cool
/// Throw StorageTypeWrongCppType if the attribute has the wrong C++ type.
/// Throw StorageTypeInvalidValue for values outside the allowed range.
virtual void validate( const coral::Attribute& attribute,
const bool checkName = true ) const = 0;
bool checkName = true ) const = 0;
};
......
// $Id: IFolderSet.h,v 1.5 2007-01-10 17:07:35 avalassi Exp $
// $Id: IFolderSet.h,v 1.6 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IFOLDERSET_H
#define COOLKERNEL_IFOLDERSET_H
......@@ -30,12 +30,12 @@ namespace cool {
/// Lists all folders at this level in the node hierarchy
/// (ordered alphabetically ascending/descending)
virtual std::vector<std::string>
listFolders( const bool ascending = true ) = 0;
listFolders( bool ascending = true ) = 0;
/// Lists all foldersets at this level in the node hierarchy
/// (ordered alphabetically ascending/descending)
virtual std::vector<std::string>
listFolderSets( const bool ascending = true ) = 0;
listFolderSets( bool ascending = true ) = 0;
/// Return the 'attributes' of the folderset
/// (implementation-specific properties not exposed in the API).
......
......@@ -33,7 +33,7 @@ namespace cool
virtual ~IFolderSpecification() {}
/// Get the versioning mode.
virtual const FolderVersioning::Mode versioningMode() const = 0;
virtual FolderVersioning::Mode versioningMode() const = 0;
/// Get the payload specification.
virtual const IRecordSpecification& payloadSpecification() const = 0;
......@@ -44,16 +44,16 @@ namespace cool
*/
/// Comparison operator.
const bool operator==( const IFolderSpecification& rhs ) const;
bool operator==( const IFolderSpecification& rhs ) const;
/// Comparison operator.
const bool operator!=( const IFolderSpecification& rhs ) const;
bool operator!=( const IFolderSpecification& rhs ) const;
};
//--------------------------------------------------------------------------
inline const bool
inline bool
IFolderSpecification::operator==( const IFolderSpecification& rhs ) const
{
if ( versioningMode() != rhs.versioningMode() ) return false;
......@@ -64,7 +64,7 @@ namespace cool
//--------------------------------------------------------------------------
inline const bool
inline bool
IFolderSpecification::operator!=( const IFolderSpecification& rhs ) const
{
return ( ! ( *this == rhs ) );
......
// $Id: IHvsNodeRecord.h,v 1.13 2007-01-17 16:19:26 avalassi Exp $
// $Id: IHvsNodeRecord.h,v 1.14 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IHVSNODERECORD_H
#define COOLKERNEL_IHVSNODERECORD_H
......@@ -51,10 +51,10 @@ namespace cool {
virtual const std::string& description() const = 0;
/// Is this a leaf node?
virtual const bool isLeaf() const = 0;
virtual bool isLeaf() const = 0;
/// Has this node been stored into the database?
virtual const bool isStored() const = 0;
virtual bool isStored() const = 0;
/// Insertion time into the database.
/// Throws an exception if the node has not been stored yet.
......@@ -62,12 +62,12 @@ namespace cool {
/// System-assigned node ID.
/// Throws an exception if the node has not been stored yet.
virtual const UInt32 id() const = 0;
virtual UInt32 id() const = 0;
/// System-assigned ID of the parent node.
/// Throws an exception if the node has not been stored yet.
/// Convention: parentId() = id() if the node has no parent (root node).
virtual const UInt32 parentId() const = 0;
virtual UInt32 parentId() const = 0;
protected:
......
// $Id: IObject.h,v 1.40 2008-10-30 15:45:46 avalassi Exp $
// $Id: IObject.h,v 1.41 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IOBJECT_H
#define COOLKERNEL_IOBJECT_H 1
......@@ -35,7 +35,7 @@ namespace cool
virtual IObject* clone() const = 0;
/// Channel identifier
virtual const ChannelId& channelId() const = 0;
virtual ChannelId& channelId() const = 0;
/// Channel name
//virtual const std::string& channelName() const = 0;
......@@ -72,7 +72,7 @@ namespace cool
}
/// Has the object been stored into the database?
virtual const bool isStored() const = 0;
virtual bool isStored() const = 0;
/// System-assigned object ID
/// (single 'surrogate PK' ID unique in the folder across all channels)
......@@ -80,7 +80,7 @@ namespace cool
/// WARNING! This is mainly for internal COOL developers and is subject
/// to changes: there is no guarantee that storing the same objects
/// will result in the same objectId values. USE AT YOUR OWN RISK!
virtual const UInt32 objectId() const = 0;
virtual UInt32 objectId() const = 0;
/// Insertion time into the database
/// Throws an exception if the object has not been stored yet
......
// $Id: IObjectIterator.h,v 1.29 2008-10-30 15:51:20 avalassi Exp $
// $Id: IObjectIterator.h,v 1.30 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IOBJECTITERATOR_H
#define COOLKERNEL_IOBJECTITERATOR_H 1
......@@ -59,12 +59,12 @@ namespace cool
virtual ~IObjectIterator() {}
/// Does the iterator have zero objects in the loop?
virtual const bool isEmpty() = 0;
virtual bool isEmpty() = 0;
/*
/// OBSOLETE! WILL BE REMOVED IN COOL 3.0.0!
/// Does the iterator have any objects after the current one in the loop?
virtual const bool hasNext() = 0;
virtual bool hasNext() = 0;
/// OBSOLETE! WILL BE REMOVED IN COOL 3.0.0!
/// Retrieve a shared pointer to the current object in the iterator loop.
......@@ -82,7 +82,7 @@ namespace cool
/// COOL 2.2.0 - NEW (RECOMMENDED) API
/// Fetch the next object in the iterator loop.
/// Return false if there is no next object.
virtual const bool goToNext() = 0;
virtual bool goToNext() = 0;
/// COOL 2.2.0 - NEW (RECOMMENDED) API
/// Retrieve a reference to the current object in the iterator loop.
......
// $Id: IRecord.h,v 1.30 2006-12-11 12:56:56 avalassi Exp $
// $Id: IRecord.h,v 1.31 2008-11-04 10:18:30 avalassi Exp $
#ifndef COOLKERNEL_IRECORD_H
#define COOLKERNEL_IRECORD_H 1
......@@ -73,24 +73,24 @@ namespace cool
virtual const IRecordSpecification& specification() const = 0;
/// Return the number of fields in this record (from the spec).
const UInt32 size() const;
UInt32 size() const;
/// Return the index of a field in this record by its name (from the spec).
const UInt32 index( const std::string& name ) const;
UInt32 index( const std::string& name ) const;
/// Return a field in this record by its name (const).
const IField& operator[] ( const std::string& name ) const;
/// Return a field in this record by its index in [0, N-1] (const).
const IField& operator[] ( const UInt32 index ) const;
const IField& operator[] ( UInt32 index ) const;
/// Comparison operator. Two records are equal if they have the same
/// fields (each with the same name, type and value), in the same order.
virtual const bool operator== ( const IRecord& rhs ) const;
virtual bool operator== ( const IRecord& rhs ) const;
/// Comparison operator. Two records are equal if they have the same
/// fields (each with the same name, type and value), in the same order.
virtual const bool operator!= ( const IRecord& rhs ) const;