S R T B H P N

ClassAnatomy.h, ClassAnatomy.cpp, ClassAnatomy.txt, Classes webpage

Illustrates all of the basic parts of a class, e.g., Constructors, operators, destructor, and member data.

ClassAnatomy.h

#ifndef TESTCLASS_H
#define TESTCLASS_H
/////////////////////////////////////////////////////////////////////////////
// TestClass.h - Implemented to demonstrate class operations               //
//                                                                         //
// Application:  CSE687 - OOD demonstration, Fall 2018                     //
// Platform:     Dell XPS 8920, Win 10 Pro, Visual Studio 2017             //
// Author:       Jim Fawcett, Syracuse University, CST 4-187               //
//               jfawcett@twcny.rr.com, http://ecs.syr.edu/faculty/fawcett //
/////////////////////////////////////////////////////////////////////////////
/*
*  Package Operations
* --------------------
*  This package provides a single class: TestClass.  It is intended to demonstrate 
*  standard class operations, e.g., copy, assignment, move, and destruction.
*  - TestClass provides all the standard class methods
*  - all its methods enunciate.  That is, they write to the console as they
*    execute.
*
*  Required Files:
* -----------------
* - TestClass.h, TestClass.cpp, Helpers.h, Helpers.cpp
*
*  Maintenance History:
* ----------------------
*  ver 1.1 : 18 Aug 2018
*  - changed implementation of most of the operations for clarity
*  Ver 1.0 : 08 Jan 2014
*  - first release
*/

#include 

class Test
{
public:
  Test();                           // void constructor, sometimes called default constructor
  Test(const std::string& name);    // constructor for named instance
  Test(const Test& t);              // copy constructor
  Test(Test&& t);                   // move constructor
  Test& operator=(const Test& t);   // copy assignment operator
  Test& operator=(Test&& t);        // move assignment operator
  virtual ~Test();                  // destructor
  std::string& name();
  void say();
private:
  std::string name_;
};
#endif