Category : C++ Source Code
Archive   : IDIOMS.ZIP
Filename : EV2TRI.H

 
Output of file : EV2TRI.H contained in archive : IDIOMS.ZIP
/* Copyright (c) 1992 by AT&T Bell Laboratories. */
/* Advanced C++ Programming Styles and Idioms */
/* James O. Coplien */
/* All rights reserved. */

//************************************************************//
// //
// F I L E : E V 2 T R I . H //
// //
// Modified interface for class Triangle (Version 2) //
// //
//************************************************************//

#define _TRIANGLE_H
#ifndef _SHAPEREP_H
#include "eshaprp.h"
#endif
#ifndef _COORDINATE_H
#include "ecoord.h"
#endif

class Triangle: public ShapeRep {
public:
// Just like Triangle.h, except set up for a
// new definition of Triangle::move
Shape make();
Shape make(Coordinate, Coordinate, Coordinate);
Triangle();
void draw();
void move(Coordinate);
void rotate(double);
void *operator new(size_t);
void operator delete(void *);
void gc(size_t = 0);
Triangle(Exemplar);
static void init();
private:
static void poolInit(size_t);
Shape make(Coordinate) { return *aShape; }
Shape make(Coordinate, Coordinate) { return *aShape; }
Coordinate p1, p2, p3;
private:
static char *heap;
static size_t poolInitialized;
enum { PoolSize = 10 };
};

extern ShapeRep *triangle;


  3 Responses to “Category : C++ Source Code
Archive   : IDIOMS.ZIP
Filename : EV2TRI.H

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/