SimpleCxxLib
package
The SimpleCxxLib
package is a simple C++ library for
introductory CS which is currently being used in
CS101: Programming Abstractions in C++ course.
This is a fork from
the Stanford C++ libraries
originally developed by Eric Roberts and Keith Schwarz. This unofficial modified version is
written and maintained by Xue Hao(xuehao0618@outlook.com).
This package is free software: you can redistribute it and/or modify it under the terms of GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Download the latest version here:
The SimpleCxxLib
package defines a set of libraries that make
it easier to write programs in C++. The facilities provided by these
libraries can be broken down into the following groups:
console.h
, direction.h
,
error.h
, filelib.h
, gmath.h
, random.h
, simpio.h
, strlib.h
, thread.h
) export
collections of free functions instead of classes.
Graph
,
Grid
, HashMap
, HashSet
, Lexicon
, Map
, PriorityQueue
, Queue
, Set
, Stack
, Vector
)
represent collections of other objects. These collections work in
much the same way as the similar classes in the Standard Template
Library (STL).
SimpleCxxLib
package are used to support
graphics. These classes can themselves be broken down into the
following categories:
GWindow
class,
which represents a window that appears on the display screen
GObject
(GArc
, GCompound
, GImage
, GLabel
, GLine
, GOval
, GPolygon
, GRect
, G3DRect
,
GRoundRect
)
GCheckBox
, GChooser
, GSlider
,
GTextField
, GButton
)
GEvent
,
GActionEvent
, GKeyEvent
,
GMouseEvent
,
GTimerEvent
,
GWindowEvent
)
GDimension
, GPoint
,
GRectangle
)
ErrorException
, Lock
, Point
, Sound
, Thread
,
TokenScanner
).
Additional documentation appears in the web pages for the individual classes, along with sample code.
Classes | |
|
This exception is thrown by calls to the error function.
|
|
This graphical object subclass represents a rectangular box that can be raised or lowered. |
|
This event subclass represents an action event. |
|
This graphical object subclass represents an elliptical arc. |
|
This interactor subclass represents an onscreen button. |
|
This interactor subclass represents an onscreen check box. |
|
This interactor subclass represents a selectable list. |
|
This graphical object subclass consists of a collection of other graphical objects. |
|
This class contains real-valued width and height fields. |
|
This class is the root of the hierarchy for all events. |
|
This graphical object subclass represents an image from a file. |
|
This abstract class is the superclass for all graphical interactors. |
|
This event subclass represents a key event. |
|
This graphical object subclass represents a text string. |
|
This graphical object subclass represents a line segment. |
|
This event subclass represents a mouse event. |
|
This class is the common superclass of all graphical objects that can be displayed on a graphical window. |
|
This graphical object subclass represents an oval inscribed in a rectangular box. |
|
This class contains real-valued x and y fields. |
|
This graphical object subclass represents a polygon bounded by line segments. |
|
This class represents a graph with the specified node and arc types. |
|
This class represents a graphical object whose appearance consists of a rectangular box. |
|
This type contains real-valued x, y, width, and height fields. |
|
This class stores an indexed, two-dimensional array. |
|
This class represents a graphical object whose appearance consists of a rectangular box with rounded corners. |
|
This interactor subclass represents an onscreen slider. |
|
This interactor subclass represents a text field for entering short text strings. |
|
This class implements a simple interval timer that generates a
GTimerEvent with a specified frequency.
|
|
This event subclass represents a timer event. |
|
This class represents a graphics window that supports simple graphics. |
|
This event subclass represents a window event. |
|
This class implements an efficient association between keys and values. |
|
This class implements an efficient abstraction for storing sets of distinct elements. |
|
This class is used to represent a lexicon, or word list. |
|
This class represents a simple lock used to control concurrency. |
|
This class maintains an association between keys and values. |
|
This class represents an x-y coordinate point on a two-dimensional integer grid. |
|
This class models a structure called a priority queue in which values are processed in order of priority. |
|
This class models a linear structure called a queue in which values are added at one end and removed from the other. |
|
This class stores a collection of distinct elements. |
|
This class encapsulates a sound file. |
|
This class models a linear structure called a stack in which values are added and removed only from one end. |
|
This class encapsulates a lightweight process running in the same address space as the creator. |
|
This class divides a string into individual tokens. |
|
This class stores an ordered list of values similar to an array. |
Interface files | |
|
This file redirects the cin , cout , and
cerr channels to use a console window.
|
|
This file exports an enumerated type called
Direction whose elements are the four compass points:
NORTH , EAST , SOUTH , and
WEST .
|
|
This file defines the ErrorException class and the
error function.
|
|
This file exports a standardized set of tools for working with files. |
|
This file defines the event types used in the SimpleCxxLib graphics libraries. |
|
This file exports a hierarchy of graphical interactors similar to those provided in the Java Swing libraries. |
|
This file exports several functions for working with graphical
geometry along with the mathematical constants PI and
E .
|
|
This file exports a hierarchy of graphical shapes based on the model developed for the ACM Java Graphics. |
|
This file exports a parameterized Graph class used to
represent graphs, which consist of a set of
nodes and a set of arcs.
|
|
This file exports the Grid class, which offers a
convenient abstraction for representing a two-dimensional array.
|
|
This file defines the GTimer class, which implements a
general interval timer.
|
|
This file defines classes for representing points, dimensions, and rectangles. |
|
This file defines the GWindow class which supports
drawing graphical objects on the screen.
|
|
This file exports the HashMap class, which stores a set
of key-value pairs.
|
|
This file exports the HashSet class, which implements an
efficient abstraction for storing sets of values.
|
|
This file exports the Lexicon class, which is a compact
structure for storing a list of words.
|
|
This file exports the template class Map , which maintains
a collection of key-value pairs.
|
|
This file exports a class representing an integer-valued x-y pair. |
|
This file exports the PriorityQueue class, a collection
in which values are processed in priority order.
|
|
This file exports the Queue class, a collection in which
values are ordinarily processed in a first-in/first-out (FIFO) order.
|
|
This file exports functions for generating pseudorandom numbers. |
|
This file exports the Set class, which implements a
collection for storing a set of distinct elements.
|
|
This file exports a set of functions that simplify input/output operations in C++ and provide some error-checking on console input. |
|
This file defines a class that represents a sound. |
|
This file exports the Stack class, which implements a
collection that processes values in a last-in/first-out (LIFO) order.
|
|
This file exports several useful string functions that are not included in the C++ string library. |
|
This file exports a simple, platform-independent thread abstraction, along with simple tools for concurrency control. |
|
This file exports a TokenScanner class that divides a
string into individual logical units called tokens.
|
|
This file exports the Vector class, which provides an
efficient, safe, convenient replacement for the array type in C++.
|