File: cl_float_class.h

package info (click to toggle)
cln 1.0.3-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 12,944 kB
  • ctags: 17,616
  • sloc: cpp: 76,879; ansic: 12,140; asm: 8,720; sh: 6,448; makefile: 964; lisp: 64
file content (50 lines) | stat: -rw-r--r-- 1,426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Abstract class of floating-point numbers.

#ifndef _CL_FLOAT_CLASS_H
#define _CL_FLOAT_CLASS_H

#include "cl_number.h"
#include "cl_real_class.h"


class cl_F : public cl_R {
public:
// Default constructor.
	cl_F ();
// Copy constructor.
	cl_F (const cl_F&);
// Converters.
// Assignment operators.
	cl_F& operator= (const cl_F&);
// Constructors and assignment operators from C numeric types.
	cl_F (const float);
	cl_F (const double);
	cl_F& operator= (const float);
	cl_F& operator= (const double);
// Other constructors.
	cl_F (const char *);
// Private constructor.
	cl_F (cl_private_thing);
public:	// Ability to place an object at a given address.
	void* operator new (size_t size) { return cl_malloc_hook(size); }
	void* operator new (size_t size, cl_F* ptr) { (void)size; return ptr; }
	void operator delete (void* ptr) { cl_free_hook(ptr); }
private:
// Friend declarations. They are for the compiler. Just ignore them.
};

// Private constructors.
inline cl_F::cl_F (cl_private_thing ptr) : cl_R (ptr) {}
// The assignment operators:
CL_DEFINE_ASSIGNMENT_OPERATOR(cl_F, cl_F)
// The default constructors.
inline cl_F::cl_F ()
	: cl_R ((cl_private_thing) cl_combine(cl_SF_tag,0)) {}
// The copy constructors.
CL_DEFINE_COPY_CONSTRUCTOR2(cl_F,cl_R)
// Constructors and assignment operators from C numeric types.
CL_DEFINE_FLOAT_CONSTRUCTOR(cl_F)
CL_DEFINE_DOUBLE_CONSTRUCTOR(cl_F)


#endif /* _CL_FLOAT_CLASS_H */