00001
00004 #ifndef _complex_assert_H
00005 #define _complex_assert_H
00006
00007 #include <stdarg.h>
00008 #include "gridlabd.h"
00009 using gld::complex;
00010
00011 #ifndef _isnan
00012 #define _isnan isnan
00013 #endif
00014
00015 class complex_assert : public gld_object {
00016 public:
00017 enum {FULL=0,REAL=1,IMAGINARY=2,MAGNITUDE=3,ANGLE=4};
00018 enum {ONCE_FALSE=0, ONCE_TRUE=1, ONCE_DONE=2};
00019 enum {ASSERT_TRUE=1, ASSERT_FALSE, ASSERT_NONE};
00020
00021 GL_ATOMIC(enumeration,status);
00022 GL_STRING(char1024,target);
00023 GL_ATOMIC(complex,value);
00024 GL_ATOMIC(enumeration,operation);
00025 GL_ATOMIC(enumeration,once);
00026 GL_STRUCT(complex,once_value);
00027 GL_ATOMIC(double,within);
00028
00029 public:
00030
00031 complex_assert(MODULE *module);
00032 int create(void);
00033 int init(OBJECT *parent);
00034 TIMESTAMP commit(TIMESTAMP t1, TIMESTAMP t2);
00035 int postnotify(PROPERTY *prop, char *value);
00036 inline int prenotify(PROPERTY*,char*) { return 1; };
00037
00038 public:
00039 static CLASS *oclass;
00040 static complex_assert *defaults;
00041 };
00042
00043 #endif