Skip to content

Commit

Permalink
Preparing for rwlock...
Browse files Browse the repository at this point in the history
  • Loading branch information
macmade committed Mar 21, 2017
1 parent db42328 commit 1333737
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CPPAtomic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
053BEDC41B8EFDF3007D82A4 /* GoogleMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 053BEDBD1B8EFDE6007D82A4 /* GoogleMock.framework */; };
053BEDEC1B90ABB2007D82A4 /* travis-after.sh in Resources */ = {isa = PBXBuildFile; fileRef = 053BEDE71B90ABB2007D82A4 /* travis-after.sh */; };
053BEDED1B90ABB2007D82A4 /* travis-before.sh in Resources */ = {isa = PBXBuildFile; fileRef = 053BEDE81B90ABB2007D82A4 /* travis-before.sh */; };
057CD63A1E81F36600A80970 /* RWLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 057CD6391E81F36600A80970 /* RWLock.cpp */; };
057CD6401E81F37100A80970 /* RWLock.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 057CD63F1E81F37100A80970 /* RWLock.hpp */; };
05EC8A5C1E81E945007233F2 /* libCPPAtomic.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 05EC8A471E81E854007233F2 /* libCPPAtomic.a */; };
05F58B201E81EB9D000D50A0 /* AtomicAdd32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05F58B161E81EB9D000D50A0 /* AtomicAdd32.cpp */; };
05F58B211E81EB9D000D50A0 /* AtomicAdd64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 05F58B171E81EB9D000D50A0 /* AtomicAdd64.cpp */; };
Expand Down Expand Up @@ -101,6 +103,8 @@
053BEDE81B90ABB2007D82A4 /* travis-before.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "travis-before.sh"; sourceTree = "<group>"; };
053BEDF91B90B37E007D82A4 /* Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = "<group>"; };
055F18191D99779D002B5491 /* CPPTraits.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = CPPTraits.xcodeproj; path = Submodules/CPPTraits/CPPTraits.xcodeproj; sourceTree = "<group>"; };
057CD6391E81F36600A80970 /* RWLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RWLock.cpp; sourceTree = "<group>"; };
057CD63F1E81F37100A80970 /* RWLock.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = RWLock.hpp; sourceTree = "<group>"; };
05A6C6891C18AEDD002C6A44 /* Atomic.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = Atomic.hpp; sourceTree = "<group>"; };
05EC8A471E81E854007233F2 /* libCPPAtomic.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCPPAtomic.a; sourceTree = BUILT_PRODUCTS_DIR; };
05EC8A591E81E8DD007233F2 /* Atomic-Functions.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = "Atomic-Functions.hpp"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -206,6 +210,7 @@
children = (
05A6C6891C18AEDD002C6A44 /* Atomic.hpp */,
05EC8A591E81E8DD007233F2 /* Atomic-Functions.hpp */,
057CD63F1E81F37100A80970 /* RWLock.hpp */,
05F58B2F1E81F15A000D50A0 /* Semaphore.hpp */,
);
path = XS;
Expand Down Expand Up @@ -238,6 +243,7 @@
isa = PBXGroup;
children = (
05F58B151E81EB76000D50A0 /* Atomic-Functions */,
057CD6391E81F36600A80970 /* RWLock.cpp */,
05F58B341E81F1A4000D50A0 /* Semaphore.cpp */,
);
path = source;
Expand Down Expand Up @@ -267,6 +273,7 @@
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
057CD6401E81F37100A80970 /* RWLock.hpp in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -451,6 +458,7 @@
05F58B201E81EB9D000D50A0 /* AtomicAdd32.cpp in Sources */,
05F58B211E81EB9D000D50A0 /* AtomicAdd64.cpp in Sources */,
05F58B251E81EB9D000D50A0 /* AtomicDecrement32.cpp in Sources */,
057CD63A1E81F36600A80970 /* RWLock.cpp in Sources */,
05F58B221E81EB9D000D50A0 /* AtomicCompareAndSwap32.cpp in Sources */,
05F58B281E81EB9D000D50A0 /* AtomicIncrement64.cpp in Sources */,
);
Expand Down
45 changes: 45 additions & 0 deletions CPPAtomic/include/XS/RWLock.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015 Jean-David Gadina - www.xs-labs.com / www.digidna.net
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

/*!
* @copyright (c) 2015 - Jean-David Gadina - www.xs-labs.com / www.digidna.net
* @brief ...
*/

#ifndef XS_RW_LOCK_HPP
#define XS_RW_LOCK_HPP

#include <XS/PIMPL/Object.hpp>

namespace XS
{
class RWLock: public XS::PIMPL::Object< RWLock >
{
public:

using XS::PIMPL::Object< RWLock >::impl;
};
}

#endif /* XS_RW_LOCK_HPP */
60 changes: 60 additions & 0 deletions CPPAtomic/source/RWLock.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*******************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2015 Jean-David Gadina - www.xs-labs.com / www.digidna.net
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
******************************************************************************/

/*!
* @copyright (c) 2015 - Jean-David Gadina - www.xs-labs.com / www.digidna.net
* @brief ...
*/

#include <XS/RWLock.hpp>

namespace XS
{
template<>
class XS::PIMPL::Object< RWLock >::IMPL
{
public:

IMPL( void );
IMPL( const IMPL & o );
~IMPL( void );
};
}

#define XS_PIMPL_CLASS XS::RWLock
#include <XS/PIMPL/Object-IMPL.hpp>

namespace XS
{
PIMPL::Object< RWLock >::IMPL::IMPL( void )
{}

PIMPL::Object< RWLock >::IMPL::IMPL( const IMPL & o )
{
( void )o;
}

PIMPL::Object< RWLock >::IMPL::~IMPL( void )
{}
}

0 comments on commit 1333737

Please sign in to comment.