1
0
Fork 0
arangodb/arangod/Utils/TransactionCollection.h

162 lines
5.9 KiB
C++

////////////////////////////////////////////////////////////////////////////////
/// @brief transaction collection wrapper
///
/// @file
///
/// DISCLAIMER
///
/// Copyright 2004-2012 triAGENS GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Copyright 2011-2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////
#ifndef TRIAGENS_UTILS_TRANSACTION_COLLECTION_H
#define TRIAGENS_UTILS_TRANSACTION_COLLECTION_H 1
#include "Basics/Common.h"
#include "VocBase/transaction.h"
namespace triagens {
namespace arango {
// -----------------------------------------------------------------------------
// --SECTION-- class TransactionCollection
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// --SECTION-- constructors and destructors
// -----------------------------------------------------------------------------
class TransactionCollection {
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup ArangoDB
/// @{
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// @brief copy constructors
////////////////////////////////////////////////////////////////////////////////
private:
TransactionCollection (const TransactionCollection&);
TransactionCollection& operator= (const TransactionCollection&);
public:
////////////////////////////////////////////////////////////////////////////////
/// @brief create a collection instance
////////////////////////////////////////////////////////////////////////////////
TransactionCollection (const TRI_transaction_cid_t cid,
TRI_transaction_type_e accessType) :
_cid(cid),
_accessType(accessType) {
}
////////////////////////////////////////////////////////////////////////////////
/// @brief destroy a collection instance
////////////////////////////////////////////////////////////////////////////////
~TransactionCollection () {
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- public methods
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup ArangoDB
/// @{
////////////////////////////////////////////////////////////////////////////////
public:
////////////////////////////////////////////////////////////////////////////////
/// @brief get the id of the collection
////////////////////////////////////////////////////////////////////////////////
inline const TRI_transaction_cid_t getId () const {
return _cid;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief get the access type (read or write)
////////////////////////////////////////////////////////////////////////////////
inline TRI_transaction_type_e getAccessType () const {
return _accessType;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief modify the access type (read or write)
////////////////////////////////////////////////////////////////////////////////
inline void setAccessType (TRI_transaction_type_e accessType) {
_accessType = accessType;
}
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
// -----------------------------------------------------------------------------
// --SECTION-- private methods
// -----------------------------------------------------------------------------
////////////////////////////////////////////////////////////////////////////////
/// @addtogroup ArangoDB
/// @{
////////////////////////////////////////////////////////////////////////////////
private:
////////////////////////////////////////////////////////////////////////////////
/// @brief collection id
////////////////////////////////////////////////////////////////////////////////
const TRI_transaction_cid_t _cid;
////////////////////////////////////////////////////////////////////////////////
/// @brief collection access type (read or write)
////////////////////////////////////////////////////////////////////////////////
TRI_transaction_type_e _accessType;
////////////////////////////////////////////////////////////////////////////////
/// @}
////////////////////////////////////////////////////////////////////////////////
};
}
}
#endif
// Local Variables:
// mode: outline-minor
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|/// @page\\|// --SECTION--\\|/// @\\}\\)"
// End: