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