Commit 6136d141 authored by Andrea Valassi's avatar Andrea Valassi
Browse files

Cosmetics: process through the first version of coolCppClean

(fix code indentation and remove unnecessary trailing whitespaces using emacs)

In the end I decided to process also the CoolKernel API.
These changes should have no impact at all on binary compatibility.


git-svn-id: file:///git/lcgcool.svndb/cool/trunk@16413 4525493e-7705-40b1-a816-d608a930855b
parent 46737091
// $Id: ChannelId.h,v 1.3 2007-01-17 14:48:12 avalassi Exp $
// $Id: ChannelId.h,v 1.4 2009-12-16 17:41:23 avalassi Exp $
#ifndef COOLKERNEL_CHANNELID_H
#define COOLKERNEL_CHANNELID_H
......@@ -6,13 +6,13 @@
#include "CoolKernel/types.h"
namespace cool {
/** @file ChannelId.h
*
* Type definition for the 'ID' of a channel in a COOL folder.
*
* @author Sven A. Schmidt and Andrea Valassi
* @date 2004-11-05
* @date 2004-11-05
*/
// ChannelId.
......
// $Id: ChannelSelection.h,v 1.20 2009-01-06 12:05:12 avalassi Exp $
// $Id: ChannelSelection.h,v 1.21 2009-12-16 17:41:23 avalassi Exp $
#ifndef COOLKERNEL_CHANNELSELECTION_H
#define COOLKERNEL_CHANNELSELECTION_H
......@@ -23,7 +23,7 @@ namespace cool {
* @date 2005-08-08
*/
class ChannelSelection
class ChannelSelection
{
friend class ChannelSelectionTest;
......@@ -33,14 +33,14 @@ namespace cool {
/// Internal helper class for channel ranges. Ideally this class should
/// be private but PyCool dictionary generation does not like that!
class ChannelRange
class ChannelRange
{
public:
// Required by PyCool
ChannelRange() {}
ChannelRange( const ChannelId& firstChannel,
ChannelRange( const ChannelId& firstChannel,
const ChannelId& lastChannel );
ChannelId firstChannel() const;
......
// $Id: CompositeSelection.h,v 1.6 2008-11-04 10:18:30 avalassi Exp $
// $Id: CompositeSelection.h,v 1.7 2009-12-16 17:41:23 avalassi Exp $
#ifndef COOLKERNEL_COMPOSITESELECTION_H
#define COOLKERNEL_COMPOSITESELECTION_H 1
......@@ -13,7 +13,7 @@ namespace cool
/** @class CompositeSelection CompositeSelection.h
*
* Composite selection on a data record obtained by the conjuction (AND)
* Composite selection on a data record obtained by the conjuction (AND)
* or disjunction (OR) of several simplere record selections.
*
* @author Andrea Valassi and Martin Wache
......@@ -26,39 +26,39 @@ namespace cool
public:
/// Logical connectives (logical operations).
enum Connective{ AND, OR };
enum Connective{ AND, OR };
/// Describe a logical connective.
static const std::string describe( Connective conn );
public:
/// Destructor.
virtual ~CompositeSelection();
/// Constructor for connecting two selections.
/// Each input selection is cloned (the clone is owned by this instance).
CompositeSelection( const IRecordSelection* sel1,
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( 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( Connective conn,
const IRecordSelection* sel );
/// Can the selection be applied to a record with the given specification?
bool canSelect( const IRecordSpecification& spec ) const;
/// Apply the selection to the given record.
bool select( const IRecord& record ) const;
/// Clone the record selection (and any objects referenced therein).
IRecordSelection* clone() const;
......@@ -75,16 +75,16 @@ namespace cool
/// Standard constuctor is private
CompositeSelection();
/// Copy constructor - reimplemented for the clone() method
CompositeSelection( const CompositeSelection& rhs );
/// Assignment operator is private
CompositeSelection& operator=( const CompositeSelection& rhs );
/// Constructor with a default connective and no selections - for connect()
CompositeSelection( Connective conn );
private:
/// The logical connective between connected selections.
......@@ -95,6 +95,6 @@ namespace cool
std::vector<IRecordSelection*> m_selVec;
};
}
#endif // COOLKERNEL_COMPOSITESELECTION_H
// $Id: ConstRecordAdapter.h,v 1.21 2008-11-04 10:18:30 avalassi Exp $
// $Id: ConstRecordAdapter.h,v 1.22 2009-12-16 17:41:24 avalassi Exp $
#ifndef RELATIONALCOOL_CONSTRECORDADAPTER_H
#define RELATIONALCOOL_CONSTRECORDADAPTER_H 1
......@@ -53,7 +53,7 @@ namespace cool
/// Explicit conversion to a constant coral AttributeList reference.
/// The AttributeList returned by this method contains only the attributes
/// listed in the input IRecordSpecification, which may be fewer than
/// listed in the input IRecordSpecification, which may be fewer than
/// those contained in the wrapped constant AttributeList reference.
const coral::AttributeList& attributeList() const;
......@@ -64,7 +64,7 @@ namespace cool
/// This method THROWS an exception because this is a read-only class.
IField& field( UInt32 index ); // THROWS...
private:
/// Default constructor is private
......@@ -92,6 +92,6 @@ namespace cool
coral::AttributeList m_publicAttrList;
};
}
#endif // RELATIONALCOOL_CONSTRECORDADAPTER_H
// $Id: Exception.h,v 1.52 2008-11-04 09:25:19 avalassi Exp $
// $Id: Exception.h,v 1.53 2009-12-16 17:41:24 avalassi Exp $
#ifndef COOLKERNEL_EXCEPTION_H
#define COOLKERNEL_EXCEPTION_H
......@@ -105,7 +105,7 @@ namespace cool {
/** @class DatabaseOpenInReadOnlyMode
*
* Exception thrown when attempting to update a database
* Exception thrown when attempting to update a database
* that is open in read-only mode.
*/
......@@ -116,7 +116,7 @@ namespace cool {
/// Constructor
explicit DatabaseOpenInReadOnlyMode( const std::string& domain )
: Exception
( "The database is open in read-only mode and cannot be updated",
( "The database is open in read-only mode and cannot be updated",
domain ) {}
/// Destructor
......@@ -389,7 +389,7 @@ namespace cool {
explicit ObjectNotFound( const std::string& message,
const std::string& domain )
: Exception ( "Object not found - " + message, domain ) {}
/// Destructor
virtual ~ObjectNotFound() throw() {}
......@@ -672,8 +672,8 @@ namespace cool {
*
* Channel names must be between 1 and 255 characters long; they must
* start with a letter and must contain only letters, numbers or the '_'
* character (these constraints may be relaxed in a future COOL release).
* Channel names are unique: a ChannelNameExists exception is thrown when
* character (these constraints may be relaxed in a future COOL release).
* Channel names are unique: a ChannelNameExists exception is thrown when
* attempting to create a channel with a name that is already used.
* By default, channels are created with no name, i.e. with an empty string
* "" as their name: an InvalidChannelName is thrown when trying to select
......@@ -724,38 +724,38 @@ namespace cool {
* @author Sven A. Schmidt and Andrea Valassi
* @date 2006-05-28
*/
class ChannelNotFound : public Exception {
public:
/// Constructor
explicit ChannelNotFound( const std::string& channelName,
const std::string& domain )
: Exception( "", domain )
: Exception( "", domain )
{
std::ostringstream msg;
msg << "No channel exists with name '" << channelName << "'";
setMessage( msg.str() );
}
/// Constructor
explicit ChannelNotFound( const ChannelId& channelId,
const std::string& domain )
: Exception( "", domain )
: Exception( "", domain )
{
std::ostringstream msg;
msg << "No channel exists with id=" << channelId;
setMessage( msg.str() );
}
/// Destructor
virtual ~ChannelNotFound() throw() {}
};
//--------------------------------------------------------------------------
/** @class ChannelExists
*
* Exception thrown when attempting to create a channel with a name
......@@ -764,40 +764,40 @@ namespace cool {
* @author Andrea Valassi
* @date 2006-12-16
*/
class ChannelExists : public Exception {
public:
/// Constructor
explicit ChannelExists( const std::string& folderName,
const std::string& channelName,
const std::string& domain )
: Exception( "", domain )
: Exception( "", domain )
{
std::ostringstream msg;
msg << "A channel with name '" << channelName << "' already exists"
<< " in folder '" << folderName << "'";
setMessage( msg.str() );
}
/// Constructor
explicit ChannelExists( const std::string& folderName,
const ChannelId& channelId,
const std::string& domain )
: Exception( "", domain )
: Exception( "", domain )
{
std::ostringstream msg;
msg << "A channel with id=" << channelId << " already exists"
<< " in folder '" << folderName << "'";
setMessage( msg.str() );
}
/// Destructor
virtual ~ChannelExists() throw() {}
};
//--------------------------------------------------------------------------
/** @class InvalidChannelRange
......@@ -833,13 +833,13 @@ namespace cool {
/** @class InvalidPayloadSpecification.
*
* Exception thrown when attempting to create a new folder using an
* invalid payload specification.
* Exception thrown when attempting to create a new folder using an
* invalid payload specification.
*
* Payload specifications can have at most 900 fields, including up to 10
* BLOB fields and up to 200 String255 fields; field names must be between
* 1 and 30 characters long (including only letters, digits or '_'), must
* start with a letter and cannot start with the "COOL_" prefix (in any
* BLOB fields and up to 200 String255 fields; field names must be between
* 1 and 30 characters long (including only letters, digits or '_'), must
* start with a letter and cannot start with the "COOL_" prefix (in any
* combination of lowercase and uppercase letters).
*
* @author Andrea Valassi
......@@ -861,7 +861,7 @@ namespace cool {
};
//--------------------------------------------------------------------------
/** @class PayloadSpecificationTooManyFields.
*
* Exception thrown when attempting to create a new folder using a
......@@ -871,7 +871,7 @@ namespace cool {
* @date 2007-01-08
*/
class PayloadSpecificationTooManyFields
class PayloadSpecificationTooManyFields
: public InvalidPayloadSpecification {
public:
......@@ -879,7 +879,7 @@ namespace cool {
/// Constructor
explicit PayloadSpecificationTooManyFields( UInt32 nFields,
const std::string& domain )
: InvalidPayloadSpecification( "", domain )
: InvalidPayloadSpecification( "", domain )
{
std::ostringstream msg;
msg << "Payload specification has too many fields: #fields="
......@@ -893,7 +893,7 @@ namespace cool {
};
//--------------------------------------------------------------------------
/** @class PayloadSpecificationTooManyBlobFields.
*
* Exception thrown when attempting to create a new folder using a
......@@ -903,7 +903,7 @@ namespace cool {
* @date 2007-01-08
*/
class PayloadSpecificationTooManyBlobFields
class PayloadSpecificationTooManyBlobFields
: public InvalidPayloadSpecification {
public:
......@@ -911,7 +911,7 @@ namespace cool {
/// Constructor
explicit PayloadSpecificationTooManyBlobFields( UInt32 nBlobFields,
const std::string& domain )
: InvalidPayloadSpecification( "", domain )
: InvalidPayloadSpecification( "", domain )
{
std::ostringstream msg;
msg << "Payload specification has too many BLOB fields: #blobFields="
......@@ -925,7 +925,7 @@ namespace cool {
};
//--------------------------------------------------------------------------
/** @class PayloadSpecificationTooManyString255Fields.
*
* Exception thrown when attempting to create a new folder using a
......@@ -935,16 +935,16 @@ namespace cool {
* @date 2007-01-10
*/
class PayloadSpecificationTooManyString255Fields
class PayloadSpecificationTooManyString255Fields
: public InvalidPayloadSpecification {
public:
/// Constructor
explicit
explicit
PayloadSpecificationTooManyString255Fields( UInt32 nString255Fields,
const std::string& domain )
: InvalidPayloadSpecification( "", domain )
: InvalidPayloadSpecification( "", domain )
{
std::ostringstream msg;
msg << "Payload specification has too many String255 fields:"
......@@ -958,21 +958,21 @@ namespace cool {
};
//--------------------------------------------------------------------------
/** @class PayloadSpecificationInvalidFieldName.
*
* Exception thrown when attempting to create a new folder using a
* payload specification with one or more invalid field names.
*
* Names of payload fields must have between 1 and 30 characters (including
* only letters, digits or '_'), must start with a letter and cannot start
* Names of payload fields must have between 1 and 30 characters (including
* only letters, digits or '_'), must start with a letter and cannot start
* with the "COOL_" prefix (in any lowercase/uppercase combination).
*
* @author Andrea Valassi
* @date 2007-01-08
*/
class PayloadSpecificationInvalidFieldName
class PayloadSpecificationInvalidFieldName
: public InvalidPayloadSpecification {
public:
......@@ -980,7 +980,7 @@ namespace cool {
/// Constructor
explicit PayloadSpecificationInvalidFieldName( const std::string& name,
const std::string& domain )
: InvalidPayloadSpecification( "", domain )
: InvalidPayloadSpecification( "", domain )
{
std::ostringstream msg;
msg << "Payload field has invalid name '" << name << "'";
......@@ -993,6 +993,6 @@ namespace cool {
};
//--------------------------------------------------------------------------
}
#endif
// $Id: FieldSelection.h,v 1.14 2008-11-04 10:18:30 avalassi Exp $
// $Id: FieldSelection.h,v 1.15 2009-12-16 17:41:24 avalassi Exp $
#ifndef COOLKERNEL_FIELDSELECTION_H
#define COOLKERNEL_FIELDSELECTION_H 1
......@@ -26,14 +26,14 @@ namespace cool
public:
/// Binary relation operator (comparison to a reference value).
enum Relation{ EQ, NE, GT, GE, LT, LE };
enum Relation{ EQ, NE, GT, GE, LT, LE };
/// Unary nullness operator (comparison to NULL).
enum Nullness{ IS_NULL, IS_NOT_NULL };
enum Nullness{ IS_NULL, IS_NOT_NULL };
/// Describe a binary relation operator.
static const std::string describe( Relation relation );
/// Describe a unary nullness operator.
static const std::string describe( Nullness nullness );
......@@ -41,25 +41,25 @@ namespace cool
/// Destructor.
virtual ~FieldSelection();
/// Constructor for comparison to non-NULL reference values.
template<typename T>
template<typename T>
FieldSelection( const std::string& name,
const StorageType::TypeId typeId,
Relation relation,
const T& refValue );
/// Constructor for comparison to NULL.
FieldSelection( const std::string& name,
const StorageType::TypeId typeId,
Nullness nullness );
/// Can the selection be applied to a record with the given specification?
bool canSelect( const IRecordSpecification& spec ) const;
/// Apply the selection to the given record.
bool select( const IRecord& record ) const;
/// Clone the record selection (and any objects referenced therein).
IRecordSelection* clone() const;
......@@ -79,16 +79,16 @@ namespace cool
/// Standard constuctor is private
FieldSelection();
/// Copy constructor - reimplemented for the clone() method
FieldSelection( const FieldSelection& rhs );
/// Assignment operator is private
FieldSelection& operator=( const FieldSelection& rhs );
/// Initialize - extra checks for constructor of comparison to non-NULL.
void initialize();
private:
/// The reference value (as a Record with one and only one field).
......@@ -101,10 +101,10 @@ namespace cool
Relation m_relation;
};
//---------------------------------------------------------------------------
template<typename T>
template<typename T>
inline FieldSelection::FieldSelection( const std::string& name,
const StorageType::TypeId typeId,
Relation relation,
......
// $Id: FieldSpecification.h,v 1.21 2008-11-04 10:18:30 avalassi Exp $
// $Id: FieldSpecification.h,v 1.22 2009-12-16 17:41:24 avalassi Exp $
#ifndef COOLKERNEL_FIELDSPECIFICATION_H
#define COOLKERNEL_FIELDSPECIFICATION_H 1
......@@ -9,25 +9,25 @@ namespace cool
{
class FieldSpecification : public IFieldSpecification {
public:
virtual ~FieldSpecification();
/// Constructor: create a field specification with the given name and type.
/// Throw FieldSpecificationInvalidName if name is the empty string "".
FieldSpecification( const std::string& name,
FieldSpecification( const std::string& name,
const StorageType::TypeId typeId );
/// Copy constructor.
FieldSpecification( const FieldSpecification& rhs );
/// Return the name of this field.
const std::string& name() const;
/// Return the storage type of this field.
const StorageType& storageType() const;
/// Compare the names and storage types of this and another field.
bool operator==( const IFieldSpecification& rhs ) const;
......@@ -35,18 +35,18 @@ namespace cool
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
/// The field must have the same transient C++ type and a value
/// compatible with the persistent storage type of the 'reference' field.
/// If checkName is true, the field (as well as the attribute accessible
/// If checkName is true, the field (as well as the attribute accessible
/// via the field) must also have the same name as the reference field (*).
/// Throw FieldSpecificationWrongName if field/attribute name is wrong (*).
/// Throw FieldSpecificationWrongStorageType if field has the wrong type.
/// Throw StorageTypeInvalidValue for values outside the allowed range.
void validate( const IField& field,
void validate( const IField& field,
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
/// The attribute must have the same transient C++ type and a value
/// compatible with the persistent storage type of the 'reference' field.
/// If checkName is true, the attribute must also have the same name (*).
/// Throw FieldSpecificationWrongName if attribute name is wrong (*).
......
......@@ -7,16 +7,16 @@
namespace cool
{
//--------------------------------------------------------------------------
/** @class FolderSpecification FolderSpecification.h
*
* Specification of a COOL "folder".
* Specification of a COOL "folder".
* Concrete implementation of the IFolderSpecification interface.
*
* This includes the payload specification and the versioning mode.
* The description is not included as it is a generic "HVS node"
* The description is not included as it is a generic "HVS node"
* property (it applies to folder sets as well as to folders).
*
* @author Andrea Valassi, Marco Clemencic and Martin Wache
......@@ -25,48 +25,48 @@ namespace cool
class FolderSpecification : public IFolderSpecification
{
public:
/// Destructor.
virtual ~FolderSpecification();
/// Constructor from versioning mode.
/// The payload specification has no fields (yet).
FolderSpecification( FolderVersioning::Mode mode = FolderVersioning::SINGLE_VERSION );