Skip to content

Commit 7456dca

Browse files
author
David Silver
committed
apply update
1 parent d59a211 commit 7456dca

27 files changed

+549
-503
lines changed

.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
Language: Cpp
3+
BasedOnStyle: Google

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
monitor
2+
a.out
3+
settings.json
4+
*.o
5+
build/*
6+
*.json

CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 2.6)
2+
project(monitor)
3+
4+
find_package(Curses REQUIRED)
5+
include_directories(${CURSES_INCLUDE_DIRS})
6+
7+
include_directories(include)
8+
file(GLOB SOURCES "src/*.cpp")
9+
10+
add_executable(monitor ${SOURCES})
11+
12+
set_property(TARGET monitor PROPERTY CXX_STANDARD 17)
13+
target_link_libraries(monitor ${CURSES_LIBRARIES})
14+
# TODO: Run -Werror in CI.
15+
target_compile_options(monitor PRIVATE -Wall -Wextra)

Makefile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
.PHONY: all
2+
all: format test build
3+
4+
.PHONY: format
5+
format:
6+
clang-format src/* include/* -i
7+
8+
.PHONY: build
9+
build:
10+
mkdir -p build
11+
cd build && \
12+
cmake .. && \
13+
make
14+
15+
.PHONY: debug
16+
debug:
17+
mkdir -p build
18+
cd build && \
19+
cmake -DCMAKE_BUILD_TYPE=debug .. && \
20+
make
21+
22+
.PHONY: clean
23+
clean:
24+
rm -rf build

Process.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

ProcessContainer.h

Lines changed: 0 additions & 50 deletions
This file was deleted.

ProcessParser.h

Lines changed: 0 additions & 47 deletions
This file was deleted.

README.md

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,41 @@
11
# CppND-System-Monitor
22

3-
Starter code for System Monitor Project in the C++ OOP course. Most of the code is provided for you here. Follow along with the classroom lesson to fill out the `ProcessParser` and `Process` classes to complete your project!
4-
5-
## To setup and compile in Udacity Ubuntu workspace:
6-
7-
1. Clone repository into `/home/workspace/`
8-
```
9-
cd /home/workspace/
10-
git clone https://github.com/udacity/CppND-System-Monitor
11-
```
12-
2. Follow along with the lesson and make sure you complete the `ProcessParser` and `Process` classes before attempting to run the project.
13-
14-
3. Install `ncurses` package
15-
```
16-
sudo apt-get install libncurses5-dev libncursesw5-dev
17-
```
18-
4. Compile and run
19-
```
20-
g++ -std="c++17" main.cpp -lncurses
21-
./a.out
22-
```
23-
5. In case of error that looks like the following:
24-
```
25-
root@77e30fca8a01:/home/workspace/CppND-Object-Oriented# ./a.out
26-
*** %n in writable segment detected ***
27-
Aborted (core dumped)
28-
```
29-
just keep trying `./a.out` and it should work eventually!
3+
Starter code for System Monitor Project in the Object Oriented Programming Course of the [Udacity C++ Nanodegree Program](https://www.udacity.com/course/c-plus-plus-nanodegree--nd213).
4+
5+
Follow along with the classroom lesson to complete the project!
6+
7+
![System Monitor](images/monitor.png)
8+
9+
## Udacity Linux Workspace
10+
[Udacity](https://www.udacity.com/) provides a browser-based Linux [Workspace](https://engineering.udacity.com/creating-a-gpu-enhanced-virtual-desktop-for-udacity-497bdd91a505) for students.
11+
12+
You are welcome to develop this project on your local machine, and you are not required to use the Udacity Workspace. However, the Workspace provides a convenient and consistent Linux development environment we encourage you to try.
13+
14+
## ncurses
15+
[ncurses](https://www.gnu.org/software/ncurses/) is a library that facilitates text-based graphical output in the terminal. This project relies on ncurses for display output.
16+
17+
Within the Udacity Workspace, `.student_bashrc` automatically installs ncurses every time you launch the Workspace.
18+
19+
If you are not using the Workspace, install ncurses within your own Linux environment: `sudo apt install libncurses5-dev libncursesw5-dev`
20+
21+
## Make
22+
This project uses [Make](https://www.gnu.org/software/make/). The Makefile has four targets:
23+
* `build` compiles the source code and generates an executable
24+
* `format` applies [ClangFormat](https://clang.llvm.org/docs/ClangFormat.html) to style the source code
25+
* `debug` compiles the source code and generates an executable, including debugging symbols
26+
* `clean` deletes the `build/` directory, including all of the build artifacts
27+
28+
## Instructions
29+
30+
1. Clone the project repository: `git clone https://github.com/udacity/CppND-System-Monitor-Project-Updated.git`
31+
32+
2. Build the project: `make build`
33+
34+
3. Run the resulting executable: `./build/monitor`
35+
![Starting System Monitor](images/starting_monitor.png)
36+
37+
4. Follow along with the lesson.
38+
39+
5. Implement the `System`, `Process`, and `Processor` classes, as well as functions within the `LinuxParser` namespace.
40+
41+
6. Submit!

SysInfo.h

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)