This commit is contained in:
2019-11-19 23:01:27 -07:00
parent e4cee3964d
commit 4d7d7551fc
12 changed files with 1147 additions and 124 deletions

1
HW8/.idea/vcs.xml generated
View File

@@ -2,5 +2,6 @@
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
<mapping directory="$PROJECT_DIR$/cmake-build-debug/googletest-src" vcs="Git" />
</component>
</project>

View File

@@ -1,6 +1,97 @@
cmake_minimum_required(VERSION 3.14)
project(HW8)
project(hw7)
set(CMAKE_CXX_STANDARD 17)
add_executable(HW8 main.cpp)
#
# Manually specifying all the source files.
#
set(HEADER_FILES
shared_ptr.hpp)
set(SOURCE_FILES
#TestMemory.cpp
)
set(UNIT_TEST_FILES
TestMemory.cpp)
add_executable(SharedPtr ${HEADER_FILES} ${SOURCE_FILES} main.cpp)
add_executable(UnitTestRunner ${HEADER_FILES} ${SOURCE_FILES} ${UNIT_TEST_FILES})
#
# We want the C++ 17 standard for our project
#
set_property(TARGET SharedPtr PROPERTY CXX_STANDARD 17)
set_property(TARGET UnitTestRunner PROPERTY CXX_STANDARD 17)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(SharedPtr PRIVATE /W4 /permissive-)
target_compile_options(UnitTestRunner PRIVATE /W4 /permissive-)
set_target_properties(UnitTestRunner PROPERTIES LINK_FLAGS "/STACK:10000000")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(SharedPtr PRIVATE -Wall -Wextra -pedantic -Wl,--stack,10000000 -O3)
target_compile_options(UnitTestRunner PRIVATE -Wall -Wextra -pedantic -Wl,--stack,10000000 -O3)
endif()
#
# Prepare a pre-build step to run clang-format over all the [ch]pp source files.
# Start by finding the location of the clang-format executable.
#
find_program(CLANG_FORMAT "clang-format")
if (CLANG_FORMAT)
#
# Need to take the simple source file locations used for the project and get their full
# file system locations for use in putting together the clang-format command line
#
unset(SOURCE_FILES_PATHS)
foreach(SOURCE_FILE ${HEADER_FILES} ${SOURCE_FILES} ${UNIT_TEST_FILES} main.cpp)
get_source_file_property(WHERE ${SOURCE_FILE} LOCATION)
set(SOURCE_FILES_PATHS ${SOURCE_FILES_PATHS} ${WHERE})
endforeach()
#
# This creates the clang-format target/command
#
add_custom_target(
ClangFormat
COMMAND ${CLANG_FORMAT}
-i
-style=file
${SOURCE_FILES_PATHS}
)
#
# This makes the clang-format target a dependency of the main GoogleTestIntro project
#
# add_dependencies(Weights ClangFormat)
else()
message("Unable to find clang-format")
endif()
#
# Add GoogleTest
#
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
endif()
execute_process(COMMAND ${CMAKE_COMMAND} --build .
RESULT_VARIABLE result
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
${CMAKE_CURRENT_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
# Now simply link against gtest or gtest_main as needed. Eg
target_link_libraries(UnitTestRunner gtest_main)

View File

@@ -14,6 +14,12 @@
# EXTERNAL cache entries
########################
//Builds the googlemock subproject
BUILD_GMOCK:BOOL=ON
//Path to a program.
CLANG_FORMAT:FILEPATH=/usr/local/bin/clang-format
//Path to a program.
CMAKE_AR:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ar
@@ -92,12 +98,60 @@ CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
//Enable/Disable output of compile commands during generation.
CMAKE_EXPORT_COMPILE_COMMANDS:BOOL=OFF
//User executables (bin)
CMAKE_INSTALL_BINDIR:PATH=bin
//Read-only architecture-independent data (DATAROOTDIR)
CMAKE_INSTALL_DATADIR:PATH=
//Read-only architecture-independent data root (share)
CMAKE_INSTALL_DATAROOTDIR:PATH=share
//Documentation root (DATAROOTDIR/doc/PROJECT_NAME)
CMAKE_INSTALL_DOCDIR:PATH=
//C header files (include)
CMAKE_INSTALL_INCLUDEDIR:PATH=include
//Info documentation (DATAROOTDIR/info)
CMAKE_INSTALL_INFODIR:PATH=
//Object code libraries (lib)
CMAKE_INSTALL_LIBDIR:PATH=lib
//Program executables (libexec)
CMAKE_INSTALL_LIBEXECDIR:PATH=libexec
//Locale-dependent data (DATAROOTDIR/locale)
CMAKE_INSTALL_LOCALEDIR:PATH=
//Modifiable single-machine data (var)
CMAKE_INSTALL_LOCALSTATEDIR:PATH=var
//Man documentation (DATAROOTDIR/man)
CMAKE_INSTALL_MANDIR:PATH=
//Path to a program.
CMAKE_INSTALL_NAME_TOOL:FILEPATH=/usr/bin/install_name_tool
//C header files for non-gcc (/usr/include)
CMAKE_INSTALL_OLDINCLUDEDIR:PATH=/usr/include
//Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr/local
//Run-time variable data (LOCALSTATEDIR/run)
CMAKE_INSTALL_RUNSTATEDIR:PATH=
//System admin executables (sbin)
CMAKE_INSTALL_SBINDIR:PATH=sbin
//Modifiable architecture-independent data (com)
CMAKE_INSTALL_SHAREDSTATEDIR:PATH=com
//Read-only single-machine data (etc)
CMAKE_INSTALL_SYSCONFDIR:PATH=etc
//Path to a program.
CMAKE_LINKER:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ld
@@ -151,7 +205,22 @@ CMAKE_PROJECT_DESCRIPTION:STATIC=
CMAKE_PROJECT_HOMEPAGE_URL:STATIC=
//Value Computed by CMake
CMAKE_PROJECT_NAME:STATIC=HW8
CMAKE_PROJECT_NAME:STATIC=hw7
//Value Computed by CMake
CMAKE_PROJECT_VERSION:STATIC=1.10.0
//Value Computed by CMake
CMAKE_PROJECT_VERSION_MAJOR:STATIC=1
//Value Computed by CMake
CMAKE_PROJECT_VERSION_MINOR:STATIC=10
//Value Computed by CMake
CMAKE_PROJECT_VERSION_PATCH:STATIC=0
//Value Computed by CMake
CMAKE_PROJECT_VERSION_TWEAK:STATIC=
//Path to a program.
CMAKE_RANLIB:FILEPATH=/Library/Developer/CommandLineTools/usr/bin/ranlib
@@ -218,9 +287,68 @@ HW8_BINARY_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-deb
//Value Computed by CMake
HW8_SOURCE_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8
//Enable installation of googletest. (Projects embedding googletest
// may want to turn this OFF.)
INSTALL_GTEST:BOOL=ON
//Path to a program.
PYTHON_EXECUTABLE:FILEPATH=/usr/bin/python
//Path to a program.
ProcessorCount_cmd_sysctl:FILEPATH=/usr/sbin/sysctl
//Value Computed by CMake
gmock_BINARY_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock
//Dependencies for the target
gmock_LIB_DEPENDS:STATIC=general;gtest;
//Value Computed by CMake
gmock_SOURCE_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-src/googlemock
//Build all of Google Mock's own tests.
gmock_build_tests:BOOL=OFF
//Dependencies for the target
gmock_main_LIB_DEPENDS:STATIC=general;gmock;
//Value Computed by CMake
googletest-distribution_BINARY_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build
//Value Computed by CMake
googletest-distribution_SOURCE_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-src
//Value Computed by CMake
gtest_BINARY_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest
//Value Computed by CMake
gtest_SOURCE_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-src/googletest
//Build gtest's sample programs.
gtest_build_samples:BOOL=OFF
//Build all of gtest's own tests.
gtest_build_tests:BOOL=OFF
//Disable uses of pthreads in gtest.
gtest_disable_pthreads:BOOL=OFF
//Use shared (DLL) run-time lib even when Google Test is built
// as static lib.
gtest_force_shared_crt:BOOL=ON
//Build gtest with internal symbols hidden in shared libraries.
gtest_hide_internal_symbols:BOOL=OFF
//Dependencies for the target
gtest_main_LIB_DEPENDS:STATIC=general;gtest;
//Value Computed by CMake
hw7_BINARY_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug
//Value Computed by CMake
hw7_SOURCE_DIR:STATIC=/Users/bradybodily/Repositories/CS3460/HW8
########################
# INTERNAL cache entries
@@ -298,11 +426,47 @@ CMAKE_GENERATOR_INSTANCE:INTERNAL=
CMAKE_GENERATOR_PLATFORM:INTERNAL=
//Name of generator toolset.
CMAKE_GENERATOR_TOOLSET:INTERNAL=
//Have symbol pthread_create
CMAKE_HAVE_LIBC_CREATE:INTERNAL=1
//Have include pthread.h
CMAKE_HAVE_PTHREAD_H:INTERNAL=1
//Source directory with the top level CMakeLists.txt file for this
// project
CMAKE_HOME_DIRECTORY:INTERNAL=/Users/bradybodily/Repositories/CS3460/HW8
//ADVANCED property for variable: CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_BINDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DATADIR
CMAKE_INSTALL_DATADIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DATAROOTDIR
CMAKE_INSTALL_DATAROOTDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_DOCDIR
CMAKE_INSTALL_DOCDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_INCLUDEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_INFODIR
CMAKE_INSTALL_INFODIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_LIBDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LIBEXECDIR
CMAKE_INSTALL_LIBEXECDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LOCALEDIR
CMAKE_INSTALL_LOCALEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_LOCALSTATEDIR
CMAKE_INSTALL_LOCALSTATEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_MANDIR
CMAKE_INSTALL_MANDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_NAME_TOOL
CMAKE_INSTALL_NAME_TOOL-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_OLDINCLUDEDIR
CMAKE_INSTALL_OLDINCLUDEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_RUNSTATEDIR
CMAKE_INSTALL_RUNSTATEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_SBINDIR
CMAKE_INSTALL_SBINDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_SHAREDSTATEDIR
CMAKE_INSTALL_SHAREDSTATEDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_INSTALL_SYSCONFDIR
CMAKE_INSTALL_SYSCONFDIR-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_LINKER
CMAKE_LINKER-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_MAKE_PROGRAM
@@ -320,7 +484,7 @@ CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_NM
CMAKE_NM-ADVANCED:INTERNAL=1
//number of local generators
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=1
CMAKE_NUMBER_OF_MAKEFILES:INTERNAL=4
//ADVANCED property for variable: CMAKE_OBJCOPY
CMAKE_OBJCOPY-ADVANCED:INTERNAL=1
//ADVANCED property for variable: CMAKE_OBJDUMP
@@ -361,6 +525,28 @@ CMAKE_STRIP-ADVANCED:INTERNAL=1
CMAKE_UNAME:INTERNAL=/usr/bin/uname
//ADVANCED property for variable: CMAKE_VERBOSE_MAKEFILE
CMAKE_VERBOSE_MAKEFILE-ADVANCED:INTERNAL=1
//Details about finding PythonInterp
FIND_PACKAGE_MESSAGE_DETAILS_PythonInterp:INTERNAL=[/usr/bin/python][v2.7.16()]
//Details about finding Threads
FIND_PACKAGE_MESSAGE_DETAILS_Threads:INTERNAL=[TRUE][v()]
//ADVANCED property for variable: PYTHON_EXECUTABLE
PYTHON_EXECUTABLE-ADVANCED:INTERNAL=1
//ADVANCED property for variable: ProcessorCount_cmd_sysctl
ProcessorCount_cmd_sysctl-ADVANCED:INTERNAL=1
//CMAKE_INSTALL_PREFIX during last run
_GNUInstallDirs_LAST_CMAKE_INSTALL_PREFIX:INTERNAL=/usr/local
generated_dir:INTERNAL=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/generated
//ADVANCED property for variable: gmock_build_tests
gmock_build_tests-ADVANCED:INTERNAL=1
//ADVANCED property for variable: gtest_build_samples
gtest_build_samples-ADVANCED:INTERNAL=1
//ADVANCED property for variable: gtest_build_tests
gtest_build_tests-ADVANCED:INTERNAL=1
//ADVANCED property for variable: gtest_disable_pthreads
gtest_disable_pthreads-ADVANCED:INTERNAL=1
//ADVANCED property for variable: gtest_force_shared_crt
gtest_force_shared_crt-ADVANCED:INTERNAL=1
//ADVANCED property for variable: gtest_hide_internal_symbols
gtest_hide_internal_symbols-ADVANCED:INTERNAL=1
targets_export_name:INTERNAL=GTestTargets

View File

@@ -624,3 +624,41 @@ Linking CXX executable cmTC_6bc2b
Feature record: CXX_FEATURE:0cxx_variable_templates
Feature record: CXX_FEATURE:0cxx_variadic_macros
Feature record: CXX_FEATURE:0cxx_variadic_templates
Determining if the include file pthread.h exists passed with the following output:
Change Dir: /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_d8693/fast
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_d8693.dir/build.make CMakeFiles/cmTC_d8693.dir/build
Building C object CMakeFiles/cmTC_d8693.dir/CheckIncludeFile.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_d8693.dir/CheckIncludeFile.c.o -c /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/CMakeTmp/CheckIncludeFile.c
Linking C executable cmTC_d8693
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E cmake_link_script CMakeFiles/cmTC_d8693.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_d8693.dir/CheckIncludeFile.c.o -o cmTC_d8693
Determining if the pthread_create exist passed with the following output:
Change Dir: /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make cmTC_e0f45/fast
/Library/Developer/CommandLineTools/usr/bin/make -f CMakeFiles/cmTC_e0f45.dir/build.make CMakeFiles/cmTC_e0f45.dir/build
Building C object CMakeFiles/cmTC_e0f45.dir/CheckSymbolExists.c.o
/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -o CMakeFiles/cmTC_e0f45.dir/CheckSymbolExists.c.o -c /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_e0f45
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -E cmake_link_script CMakeFiles/cmTC_e0f45.dir/link.txt --verbose=1
/Library/Developer/CommandLineTools/usr/bin/cc -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names CMakeFiles/cmTC_e0f45.dir/CheckSymbolExists.c.o -o cmTC_e0f45
File /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

View File

@@ -7,104 +7,58 @@ set(CMAKE_DEPENDS_GENERATOR "Unix Makefiles")
# The top level Makefile was generated from the following files:
set(CMAKE_MAKEFILE_DEPENDS
"CMakeCache.txt"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCCompiler.cmake.in"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCCompilerABI.c"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCInformation.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCXXCompiler.cmake.in"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCXXCompilerABI.cpp"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCXXInformation.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCheckCompilerFlagCommonPatterns.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCommonLanguageInclude.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeCompilerIdDetection.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCXXCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompileFeatures.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerABI.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineCompilerId.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDetermineSystem.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeDependentOption.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeFindBinUtils.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeFindCodeBlocks.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeGenericSystem.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeInitializeConfigs.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeLanguageInformation.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeParseImplicitIncludeInfo.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeParseImplicitLinkInfo.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeSystem.cmake.in"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakePackageConfigHelpers.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeSystemSpecificInformation.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeSystemSpecificInitialize.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeTestCCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeTestCXXCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeTestCompilerCommon.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CMakeUnixFindMake.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/ADSP-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/ARMCC-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/AppleClang-C-FeatureTests.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CheckIncludeFile.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CheckLibraryExists.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/CheckSymbolExists.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/AppleClang-C.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/AppleClang-CXX-FeatureTests.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/AppleClang-CXX.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/AppleClang-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Borland-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Bruce-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/CMakeCommonCompilerMacros.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Clang-CXX-TestableFeatures.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Clang-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Clang-DetermineCompilerInternal.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Clang.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Comeau-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Compaq-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Compaq-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Cray-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Embarcadero-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Fujitsu-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/GHS-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/GNU-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/GNU-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/GNU.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/HP-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/HP-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/IAR-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/IBMCPP-C-DetermineVersionInternal.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/IBMCPP-CXX-DetermineVersionInternal.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Intel-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/MIPSpro-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/MSVC-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/NVIDIA-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/OpenWatcom-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/PGI-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/PathScale-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/SCO-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/SDCC-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/SunPro-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/SunPro-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/TI-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/TinyCC-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/VisualAge-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/VisualAge-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/Watcom-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/XL-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/XL-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/zOS-C-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Compiler/zOS-CXX-DetermineCompiler.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/FindPackageHandleStandardArgs.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/FindPackageMessage.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/FindPythonInterp.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/FindThreads.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/GNUInstallDirs.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Internal/CMakeCheckCompilerFlag.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Internal/FeatureTesting.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Apple-AppleClang-C.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Apple-AppleClang-CXX.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Apple-Clang-C.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Apple-Clang-CXX.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Apple-Clang.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Darwin-Determine-CXX.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Darwin-Initialize.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/Darwin.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/Platform/UnixPaths.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/ProcessorCount.cmake"
"/Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.14/Modules/WriteBasicConfigVersionFile.cmake"
"../CMakeLists.txt"
"../CMakeLists.txt.in"
"CMakeFiles/3.14.5/CMakeCCompiler.cmake"
"CMakeFiles/3.14.5/CMakeCXXCompiler.cmake"
"CMakeFiles/3.14.5/CMakeSystem.cmake"
"CMakeFiles/feature_tests.c"
"CMakeFiles/feature_tests.cxx"
"googletest-src/CMakeLists.txt"
"googletest-src/googlemock/CMakeLists.txt"
"googletest-src/googlemock/cmake/gmock.pc.in"
"googletest-src/googlemock/cmake/gmock_main.pc.in"
"googletest-src/googletest/CMakeLists.txt"
"googletest-src/googletest/cmake/Config.cmake.in"
"googletest-src/googletest/cmake/gtest.pc.in"
"googletest-src/googletest/cmake/gtest_main.pc.in"
"googletest-src/googletest/cmake/internal_utils.cmake"
)
# The corresponding makefile is:
@@ -115,15 +69,20 @@ set(CMAKE_MAKEFILE_OUTPUTS
# Byproducts of CMake generate step:
set(CMAKE_MAKEFILE_PRODUCTS
"CMakeFiles/3.14.5/CMakeSystem.cmake"
"CMakeFiles/3.14.5/CMakeCCompiler.cmake"
"CMakeFiles/3.14.5/CMakeCXXCompiler.cmake"
"CMakeFiles/3.14.5/CMakeCCompiler.cmake"
"CMakeFiles/3.14.5/CMakeCXXCompiler.cmake"
"googletest-download/CMakeLists.txt"
"CMakeFiles/CMakeDirectoryInformation.cmake"
"googletest-build/CMakeFiles/CMakeDirectoryInformation.cmake"
"googletest-build/googlemock/CMakeFiles/CMakeDirectoryInformation.cmake"
"googletest-build/googletest/CMakeFiles/CMakeDirectoryInformation.cmake"
)
# Dependency information for all targets:
set(CMAKE_DEPEND_INFO_FILES
"CMakeFiles/HW8.dir/DependInfo.cmake"
"CMakeFiles/SharedPtr.dir/DependInfo.cmake"
"CMakeFiles/ClangFormat.dir/DependInfo.cmake"
"CMakeFiles/UnitTestRunner.dir/DependInfo.cmake"
"googletest-build/googlemock/CMakeFiles/gmock.dir/DependInfo.cmake"
"googletest-build/googlemock/CMakeFiles/gmock_main.dir/DependInfo.cmake"
"googletest-build/googletest/CMakeFiles/gtest_main.dir/DependInfo.cmake"
"googletest-build/googletest/CMakeFiles/gtest.dir/DependInfo.cmake"
)

View File

@@ -65,39 +65,295 @@ CMAKE_SOURCE_DIR = /Users/bradybodily/Repositories/CS3460/HW8
CMAKE_BINARY_DIR = /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug
#=============================================================================
# Target rules for target CMakeFiles/HW8.dir
# Target rules for target CMakeFiles/SharedPtr.dir
# All Build rule for target.
CMakeFiles/HW8.dir/all:
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/depend
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=1,2 "Built target HW8"
.PHONY : CMakeFiles/HW8.dir/all
CMakeFiles/SharedPtr.dir/all:
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/depend
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=1,2 "Built target SharedPtr"
.PHONY : CMakeFiles/SharedPtr.dir/all
# Include target in all.
all: CMakeFiles/HW8.dir/all
all: CMakeFiles/SharedPtr.dir/all
.PHONY : all
# Build rule for subdir invocation for target.
CMakeFiles/HW8.dir/rule: cmake_check_build_system
CMakeFiles/SharedPtr.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 2
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/HW8.dir/all
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/SharedPtr.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : CMakeFiles/HW8.dir/rule
.PHONY : CMakeFiles/SharedPtr.dir/rule
# Convenience name for target.
HW8: CMakeFiles/HW8.dir/rule
SharedPtr: CMakeFiles/SharedPtr.dir/rule
.PHONY : HW8
.PHONY : SharedPtr
# clean rule for target.
CMakeFiles/HW8.dir/clean:
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/clean
.PHONY : CMakeFiles/HW8.dir/clean
CMakeFiles/SharedPtr.dir/clean:
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/clean
.PHONY : CMakeFiles/SharedPtr.dir/clean
# clean rule for target.
clean: CMakeFiles/HW8.dir/clean
clean: CMakeFiles/SharedPtr.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target CMakeFiles/ClangFormat.dir
# All Build rule for target.
CMakeFiles/ClangFormat.dir/all:
$(MAKE) -f CMakeFiles/ClangFormat.dir/build.make CMakeFiles/ClangFormat.dir/depend
$(MAKE) -f CMakeFiles/ClangFormat.dir/build.make CMakeFiles/ClangFormat.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num= "Built target ClangFormat"
.PHONY : CMakeFiles/ClangFormat.dir/all
# Build rule for subdir invocation for target.
CMakeFiles/ClangFormat.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/ClangFormat.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : CMakeFiles/ClangFormat.dir/rule
# Convenience name for target.
ClangFormat: CMakeFiles/ClangFormat.dir/rule
.PHONY : ClangFormat
# clean rule for target.
CMakeFiles/ClangFormat.dir/clean:
$(MAKE) -f CMakeFiles/ClangFormat.dir/build.make CMakeFiles/ClangFormat.dir/clean
.PHONY : CMakeFiles/ClangFormat.dir/clean
# clean rule for target.
clean: CMakeFiles/ClangFormat.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target CMakeFiles/UnitTestRunner.dir
# All Build rule for target.
CMakeFiles/UnitTestRunner.dir/all: googletest-build/googletest/CMakeFiles/gtest_main.dir/all
CMakeFiles/UnitTestRunner.dir/all: googletest-build/googletest/CMakeFiles/gtest.dir/all
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/depend
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=3,4 "Built target UnitTestRunner"
.PHONY : CMakeFiles/UnitTestRunner.dir/all
# Include target in all.
all: CMakeFiles/UnitTestRunner.dir/all
.PHONY : all
# Build rule for subdir invocation for target.
CMakeFiles/UnitTestRunner.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 6
$(MAKE) -f CMakeFiles/Makefile2 CMakeFiles/UnitTestRunner.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : CMakeFiles/UnitTestRunner.dir/rule
# Convenience name for target.
UnitTestRunner: CMakeFiles/UnitTestRunner.dir/rule
.PHONY : UnitTestRunner
# clean rule for target.
CMakeFiles/UnitTestRunner.dir/clean:
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/clean
.PHONY : CMakeFiles/UnitTestRunner.dir/clean
# clean rule for target.
clean: CMakeFiles/UnitTestRunner.dir/clean
.PHONY : clean
#=============================================================================
# Directory level rules for directory googletest-build
# Convenience name for "all" pass in the directory.
googletest-build/all: googletest-build/googlemock/all
.PHONY : googletest-build/all
# Convenience name for "clean" pass in the directory.
googletest-build/clean: googletest-build/googlemock/clean
.PHONY : googletest-build/clean
# Convenience name for "preinstall" pass in the directory.
googletest-build/preinstall: googletest-build/googlemock/preinstall
.PHONY : googletest-build/preinstall
#=============================================================================
# Directory level rules for directory googletest-build/googlemock
# Convenience name for "all" pass in the directory.
googletest-build/googlemock/all: googletest-build/googletest/all
.PHONY : googletest-build/googlemock/all
# Convenience name for "clean" pass in the directory.
googletest-build/googlemock/clean: googletest-build/googlemock/CMakeFiles/gmock.dir/clean
googletest-build/googlemock/clean: googletest-build/googlemock/CMakeFiles/gmock_main.dir/clean
googletest-build/googlemock/clean: googletest-build/googletest/clean
.PHONY : googletest-build/googlemock/clean
# Convenience name for "preinstall" pass in the directory.
googletest-build/googlemock/preinstall: googletest-build/googletest/preinstall
.PHONY : googletest-build/googlemock/preinstall
#=============================================================================
# Target rules for target googletest-build/googlemock/CMakeFiles/gmock.dir
# All Build rule for target.
googletest-build/googlemock/CMakeFiles/gmock.dir/all: googletest-build/googletest/CMakeFiles/gtest.dir/all
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock.dir/build.make googletest-build/googlemock/CMakeFiles/gmock.dir/depend
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock.dir/build.make googletest-build/googlemock/CMakeFiles/gmock.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=5,6 "Built target gmock"
.PHONY : googletest-build/googlemock/CMakeFiles/gmock.dir/all
# Build rule for subdir invocation for target.
googletest-build/googlemock/CMakeFiles/gmock.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 4
$(MAKE) -f CMakeFiles/Makefile2 googletest-build/googlemock/CMakeFiles/gmock.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : googletest-build/googlemock/CMakeFiles/gmock.dir/rule
# Convenience name for target.
gmock: googletest-build/googlemock/CMakeFiles/gmock.dir/rule
.PHONY : gmock
# clean rule for target.
googletest-build/googlemock/CMakeFiles/gmock.dir/clean:
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock.dir/build.make googletest-build/googlemock/CMakeFiles/gmock.dir/clean
.PHONY : googletest-build/googlemock/CMakeFiles/gmock.dir/clean
# clean rule for target.
clean: googletest-build/googlemock/CMakeFiles/gmock.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target googletest-build/googlemock/CMakeFiles/gmock_main.dir
# All Build rule for target.
googletest-build/googlemock/CMakeFiles/gmock_main.dir/all: googletest-build/googletest/CMakeFiles/gtest.dir/all
googletest-build/googlemock/CMakeFiles/gmock_main.dir/all: googletest-build/googlemock/CMakeFiles/gmock.dir/all
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock_main.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_main.dir/depend
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock_main.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_main.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=7,8 "Built target gmock_main"
.PHONY : googletest-build/googlemock/CMakeFiles/gmock_main.dir/all
# Build rule for subdir invocation for target.
googletest-build/googlemock/CMakeFiles/gmock_main.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 6
$(MAKE) -f CMakeFiles/Makefile2 googletest-build/googlemock/CMakeFiles/gmock_main.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : googletest-build/googlemock/CMakeFiles/gmock_main.dir/rule
# Convenience name for target.
gmock_main: googletest-build/googlemock/CMakeFiles/gmock_main.dir/rule
.PHONY : gmock_main
# clean rule for target.
googletest-build/googlemock/CMakeFiles/gmock_main.dir/clean:
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock_main.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_main.dir/clean
.PHONY : googletest-build/googlemock/CMakeFiles/gmock_main.dir/clean
# clean rule for target.
clean: googletest-build/googlemock/CMakeFiles/gmock_main.dir/clean
.PHONY : clean
#=============================================================================
# Directory level rules for directory googletest-build/googletest
# Convenience name for "all" pass in the directory.
googletest-build/googletest/all:
.PHONY : googletest-build/googletest/all
# Convenience name for "clean" pass in the directory.
googletest-build/googletest/clean: googletest-build/googletest/CMakeFiles/gtest_main.dir/clean
googletest-build/googletest/clean: googletest-build/googletest/CMakeFiles/gtest.dir/clean
.PHONY : googletest-build/googletest/clean
# Convenience name for "preinstall" pass in the directory.
googletest-build/googletest/preinstall:
.PHONY : googletest-build/googletest/preinstall
#=============================================================================
# Target rules for target googletest-build/googletest/CMakeFiles/gtest_main.dir
# All Build rule for target.
googletest-build/googletest/CMakeFiles/gtest_main.dir/all: googletest-build/googletest/CMakeFiles/gtest.dir/all
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest_main.dir/build.make googletest-build/googletest/CMakeFiles/gtest_main.dir/depend
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest_main.dir/build.make googletest-build/googletest/CMakeFiles/gtest_main.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=11,12 "Built target gtest_main"
.PHONY : googletest-build/googletest/CMakeFiles/gtest_main.dir/all
# Build rule for subdir invocation for target.
googletest-build/googletest/CMakeFiles/gtest_main.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 4
$(MAKE) -f CMakeFiles/Makefile2 googletest-build/googletest/CMakeFiles/gtest_main.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : googletest-build/googletest/CMakeFiles/gtest_main.dir/rule
# Convenience name for target.
gtest_main: googletest-build/googletest/CMakeFiles/gtest_main.dir/rule
.PHONY : gtest_main
# clean rule for target.
googletest-build/googletest/CMakeFiles/gtest_main.dir/clean:
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest_main.dir/build.make googletest-build/googletest/CMakeFiles/gtest_main.dir/clean
.PHONY : googletest-build/googletest/CMakeFiles/gtest_main.dir/clean
# clean rule for target.
clean: googletest-build/googletest/CMakeFiles/gtest_main.dir/clean
.PHONY : clean
#=============================================================================
# Target rules for target googletest-build/googletest/CMakeFiles/gtest.dir
# All Build rule for target.
googletest-build/googletest/CMakeFiles/gtest.dir/all:
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest.dir/build.make googletest-build/googletest/CMakeFiles/gtest.dir/depend
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest.dir/build.make googletest-build/googletest/CMakeFiles/gtest.dir/build
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --progress-dir=/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles --progress-num=9,10 "Built target gtest"
.PHONY : googletest-build/googletest/CMakeFiles/gtest.dir/all
# Build rule for subdir invocation for target.
googletest-build/googletest/CMakeFiles/gtest.dir/rule: cmake_check_build_system
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 2
$(MAKE) -f CMakeFiles/Makefile2 googletest-build/googletest/CMakeFiles/gtest.dir/all
$(CMAKE_COMMAND) -E cmake_progress_start /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles 0
.PHONY : googletest-build/googletest/CMakeFiles/gtest.dir/rule
# Convenience name for target.
gtest: googletest-build/googletest/CMakeFiles/gtest.dir/rule
.PHONY : gtest
# clean rule for target.
googletest-build/googletest/CMakeFiles/gtest.dir/clean:
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest.dir/build.make googletest-build/googletest/CMakeFiles/gtest.dir/clean
.PHONY : googletest-build/googletest/CMakeFiles/gtest.dir/clean
# clean rule for target.
clean: googletest-build/googletest/CMakeFiles/gtest.dir/clean
.PHONY : clean

View File

@@ -1,3 +1,31 @@
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/install/local.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/install/strip.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/install.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/list_install_components.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/SharedPtr.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/rebuild_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/edit_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/HW8.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/ClangFormat.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/CMakeFiles/UnitTestRunner.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/CMakeFiles/install/local.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/CMakeFiles/install/strip.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/CMakeFiles/install.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/CMakeFiles/list_install_components.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/CMakeFiles/rebuild_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/CMakeFiles/edit_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/install/local.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/install/strip.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/install.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/gmock.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/rebuild_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/edit_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/gmock_main.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googlemock/CMakeFiles/list_install_components.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/install/local.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/list_install_components.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/rebuild_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/edit_cache.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/install/strip.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/install.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/gtest_main.dir
/Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-build/googletest/CMakeFiles/gtest.dir

View File

@@ -1,18 +1,15 @@
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /Users/bradybodily/Repositories/CS3460/HW8
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc
-- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++
-- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug/googletest-download
[ 11%] Performing update step for 'googletest'
Current branch master is up to date.
[ 22%] No configure step for 'googletest'
[ 33%] No build step for 'googletest'
[ 44%] No install step for 'googletest'
[ 55%] No test step for 'googletest'
[ 66%] Completed 'googletest'
[100%] Built target googletest
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug

View File

@@ -80,6 +80,9 @@
</MakeCommands>
</Target>
</Build>
<Unit filename="/Users/bradybodily/Repositories/CS3460/HW8/ shared_ptr.hpp">
<Option target="HW8"/>
</Unit>
<Unit filename="/Users/bradybodily/Repositories/CS3460/HW8/main.cpp">
<Option target="HW8"/>
</Unit>

View File

@@ -56,6 +56,52 @@ CMAKE_BINARY_DIR = /Users/bradybodily/Repositories/CS3460/HW8/cmake-build-debug
#=============================================================================
# Targets provided globally by CMake.
# Special rule for the target install/local
install/local: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local
# Special rule for the target install/local
install/local/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
.PHONY : install/local/fast
# Special rule for the target install/strip
install/strip: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip
# Special rule for the target install/strip
install/strip/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
.PHONY : install/strip/fast
# Special rule for the target install
install: preinstall
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -P cmake_install.cmake
.PHONY : install
# Special rule for the target install
install/fast: preinstall/fast
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -P cmake_install.cmake
.PHONY : install/fast
# Special rule for the target list_install_components
list_install_components:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
.PHONY : list_install_components
# Special rule for the target list_install_components
list_install_components/fast: list_install_components
.PHONY : list_install_components/fast
# Special rule for the target rebuild_cache
rebuild_cache:
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
@@ -111,17 +157,122 @@ depend:
.PHONY : depend
#=============================================================================
# Target rules for targets named HW8
# Target rules for targets named SharedPtr
# Build rule for target.
HW8: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 HW8
.PHONY : HW8
SharedPtr: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 SharedPtr
.PHONY : SharedPtr
# fast build rule for target.
HW8/fast:
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/build
.PHONY : HW8/fast
SharedPtr/fast:
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/build
.PHONY : SharedPtr/fast
#=============================================================================
# Target rules for targets named ClangFormat
# Build rule for target.
ClangFormat: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 ClangFormat
.PHONY : ClangFormat
# fast build rule for target.
ClangFormat/fast:
$(MAKE) -f CMakeFiles/ClangFormat.dir/build.make CMakeFiles/ClangFormat.dir/build
.PHONY : ClangFormat/fast
#=============================================================================
# Target rules for targets named UnitTestRunner
# Build rule for target.
UnitTestRunner: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 UnitTestRunner
.PHONY : UnitTestRunner
# fast build rule for target.
UnitTestRunner/fast:
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/build
.PHONY : UnitTestRunner/fast
#=============================================================================
# Target rules for targets named gmock
# Build rule for target.
gmock: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 gmock
.PHONY : gmock
# fast build rule for target.
gmock/fast:
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock.dir/build.make googletest-build/googlemock/CMakeFiles/gmock.dir/build
.PHONY : gmock/fast
#=============================================================================
# Target rules for targets named gmock_main
# Build rule for target.
gmock_main: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 gmock_main
.PHONY : gmock_main
# fast build rule for target.
gmock_main/fast:
$(MAKE) -f googletest-build/googlemock/CMakeFiles/gmock_main.dir/build.make googletest-build/googlemock/CMakeFiles/gmock_main.dir/build
.PHONY : gmock_main/fast
#=============================================================================
# Target rules for targets named gtest_main
# Build rule for target.
gtest_main: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 gtest_main
.PHONY : gtest_main
# fast build rule for target.
gtest_main/fast:
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest_main.dir/build.make googletest-build/googletest/CMakeFiles/gtest_main.dir/build
.PHONY : gtest_main/fast
#=============================================================================
# Target rules for targets named gtest
# Build rule for target.
gtest: cmake_check_build_system
$(MAKE) -f CMakeFiles/Makefile2 gtest
.PHONY : gtest
# fast build rule for target.
gtest/fast:
$(MAKE) -f googletest-build/googletest/CMakeFiles/gtest.dir/build.make googletest-build/googletest/CMakeFiles/gtest.dir/build
.PHONY : gtest/fast
TestMemory.o: TestMemory.cpp.o
.PHONY : TestMemory.o
# target to build an object file
TestMemory.cpp.o:
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/TestMemory.cpp.o
.PHONY : TestMemory.cpp.o
TestMemory.i: TestMemory.cpp.i
.PHONY : TestMemory.i
# target to preprocess a source file
TestMemory.cpp.i:
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/TestMemory.cpp.i
.PHONY : TestMemory.cpp.i
TestMemory.s: TestMemory.cpp.s
.PHONY : TestMemory.s
# target to generate assembly for a file
TestMemory.cpp.s:
$(MAKE) -f CMakeFiles/UnitTestRunner.dir/build.make CMakeFiles/UnitTestRunner.dir/TestMemory.cpp.s
.PHONY : TestMemory.cpp.s
main.o: main.cpp.o
@@ -129,7 +280,7 @@ main.o: main.cpp.o
# target to build an object file
main.cpp.o:
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/main.cpp.o
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/main.cpp.o
.PHONY : main.cpp.o
main.i: main.cpp.i
@@ -138,7 +289,7 @@ main.i: main.cpp.i
# target to preprocess a source file
main.cpp.i:
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/main.cpp.i
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/main.cpp.i
.PHONY : main.cpp.i
main.s: main.cpp.s
@@ -147,7 +298,7 @@ main.s: main.cpp.s
# target to generate assembly for a file
main.cpp.s:
$(MAKE) -f CMakeFiles/HW8.dir/build.make CMakeFiles/HW8.dir/main.cpp.s
$(MAKE) -f CMakeFiles/SharedPtr.dir/build.make CMakeFiles/SharedPtr.dir/main.cpp.s
.PHONY : main.cpp.s
# Help Target
@@ -156,9 +307,22 @@ help:
@echo "... all (the default if no target is provided)"
@echo "... clean"
@echo "... depend"
@echo "... install/local"
@echo "... install/strip"
@echo "... install"
@echo "... list_install_components"
@echo "... SharedPtr"
@echo "... rebuild_cache"
@echo "... edit_cache"
@echo "... HW8"
@echo "... ClangFormat"
@echo "... UnitTestRunner"
@echo "... gmock"
@echo "... gmock_main"
@echo "... gtest_main"
@echo "... gtest"
@echo "... TestMemory.o"
@echo "... TestMemory.i"
@echo "... TestMemory.s"
@echo "... main.o"
@echo "... main.i"
@echo "... main.s"

View File

@@ -2,7 +2,307 @@
// Created by Brady Bodily on 11/19/19.
//
#ifndef HW7_SHARED_PTR_HPP
#define HW7_SHARED_PTR_HPP
#ifndef HW8_SHARED_PTR_HPP
#define HW8_SHARED_PTR_HPP
#include <algorithm>
#include <iostream>
#endif //HW7_SHARED_PTR_HPP
namespace usu
{
template <typename T>
class shared_ptr
{
protected:
int* count;
T* pointer;
public:
shared_ptr();
shared_ptr(T* input_ptr);
shared_ptr(shared_ptr<T>&& r);
shared_ptr(const shared_ptr<T>& r);
T operator*();
T* operator->();
shared_ptr& operator=(shared_ptr<T>&& r);
shared_ptr& operator=(const shared_ptr<T>& r);
T* get() { return pointer; };
unsigned int use_count() { return *count; };
~shared_ptr();
};
///
/// Default Constructor
///
/// \tparam T
template <typename T>
shared_ptr<T>::shared_ptr()
{
pointer = new T();
count = new int(1);
}
/// overloaded constructor
///
/// \tparam T
/// \param input_ptr
template <typename T>
shared_ptr<T>::shared_ptr(T* input_ptr) :
pointer(input_ptr)
{
count = new int(1);
}
/// Move Constructor
///
/// \tparam T
/// \param r
template <typename T>
shared_ptr<T>::shared_ptr(shared_ptr<T>&& r)
{
this->count = r.count;
this->pointer = r.pointer;
r.pointer = nullptr;
r.count = new int(0);
}
/// Move Assignment operator
///
/// \tparam T
/// \param r
/// \return
template <typename T>
shared_ptr<T>& shared_ptr<T>::operator=(shared_ptr<T>&& r)
{
if (this != &r)
{
std::swap(this->pointer, r.pointer);
std::swap(this->count, r.count);
}
return *this;
}
/// Copy Constructor
///
/// \tparam T
/// \param r
template <typename T>
shared_ptr<T>::shared_ptr(const shared_ptr<T>& r) :
pointer(r.pointer), count(r.count)
{
*count += 1;
}
/// Assignment operator
///
/// \tparam T
/// \param r
/// \return
template <typename T>
shared_ptr<T>& shared_ptr<T>::operator=(const shared_ptr<T>& r)
{
this->count = r.count;
this->pointer = r.pointer;
*count += 1;
return *this;
}
/// Pointer operator
///
/// \tparam T
/// \return
template <typename T>
T* shared_ptr<T>::operator->()
{
return pointer;
}
/// Dereference pointer
///
/// \tparam T
/// \return
template <typename T>
T shared_ptr<T>::operator*()
{
return *pointer;
}
/// Destructor
///
/// \tparam T
template <typename T>
shared_ptr<T>::~shared_ptr()
{
*count -= 1;
}
template <typename T, typename... Args>
shared_ptr<T> make_shared(Args&&... args)
{
return shared_ptr<T>(new T(std::forward<Args>(args)...));
}
/////////Second Class //////////////////////
template <typename T>
class shared_ptr<T[]>
{
protected:
unsigned int elemnt_count;
int* count;
T* pointer;
public:
shared_ptr();
shared_ptr(T* raw_ptr, unsigned int elements);
shared_ptr(const shared_ptr<T[]>& r);
shared_ptr(shared_ptr<T[]>&& r);
shared_ptr& operator=(const shared_ptr<T[]>& r);
shared_ptr& operator=(shared_ptr<T[]>&& r);
T& operator[](unsigned int x);
~shared_ptr();
unsigned int use_count() { return *count; };
unsigned int size() { return elemnt_count; };
};
/// Default Constructor
///
/// \tparam T
template <typename T>
shared_ptr<T[]>::shared_ptr() :
elemnt_count(0)
{
pointer = new T[0];
count = new int(1);
}
/// Overloaded Constructor
///
/// \tparam T
/// \param input_ptr
/// \param elementCount
template <typename T>
shared_ptr<T[]>::shared_ptr(T* input_ptr, unsigned int elementCount) :
pointer(input_ptr), elemnt_count(elementCount)
{
count = new int(1);
}
/// Copy Constructor
///
/// \tparam T
/// \param r
template <typename T>
shared_ptr<T[]>::shared_ptr(const shared_ptr<T[]>& r) :
pointer(r.pointer), count(r.count), elemnt_count(r.elemnt_count)
{
*count += 1;
}
/// Move Constructor
///
/// \tparam T
/// \param r
template <typename T>
shared_ptr<T[]>::shared_ptr(shared_ptr<T[]>&& r)
{
this->pointer = r.pointer;
r.pointer = nullptr;
this->count = r.count;
r.count = new int(0);
this->elemnt_count = r.elemnt_count;
r.elemnt_count = 0;
}
///Move Assignment Operator
///
/// \tparam T
/// \param r
/// \return
template <typename T>
shared_ptr<T[]>& shared_ptr<T[]>::operator=(const shared_ptr<T[]>& r)
{
this->pointer = r.pointer;
this->count = r.count;
this->elemnt_count = r.elemnt_count;
*count += 1;
return *this;
}
/// Index opperator
///
/// \tparam T
/// \param x
/// \return
template <typename T>
T& shared_ptr<T[]>::operator[](unsigned int x)
{
return this->pointer[x];
}
///Destructor
///
/// \tparam T
template <typename T>
shared_ptr<T[]>::~shared_ptr()
{
*count -= 1;
if (!*count && pointer != nullptr)
{
delete[] pointer;
}
}
/// Move Assignment operator
///
/// \tparam T
/// \param r
/// \return
template <typename T>
shared_ptr<T[]>& shared_ptr<T[]>::operator=(shared_ptr<T[]>&& r)
{
if (this != &r)
{
std::swap(this->pointer, r.pointer);
std::swap(this->count, r.count);
std::swap(this->elemnt_count, r.elemnt_count);
}
return *this;
}
///
///
/// \tparam T
/// \tparam T2
/// \return
template <typename T, unsigned int T2>
shared_ptr<T[]> make_shared_array()
{
return shared_ptr<T[]>(new T[T2], T2);
}
} // namespace usu
#endif // HW8_SHARED_PTR_HPP