Changeset 104 for cpp/gdk/neuroimpl.h


Ignore:
Timestamp:
07/23/13 18:15:30 (11 years ago)
Author:
sz
Message:

introducing object de/serialization - see serialtest.cpp
the core GDK classes can be now used in multiple threads (ifdef MULTITHREADED)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/gdk/neuroimpl.h

    r81 r104  
    1717
    1818class Creature;
     19class NeuroLibrary;
     20class NeuroFactory;
    1921
    2022class NeuroNetConfig
    2123{
    2224public:
    23 NeuroNetConfig();
     25NeuroNetConfig(NeuroFactory *fac);
    2426
    2527Param par;
     
    2830double touchrange;
    2931
    30 static NeuroNetConfig& getGlobalConfig();
     32NeuroFactory *factory;
     33//static NeuroNetConfig& getGlobalConfig();
    3134};
    3235
     
    4043  public:
    4144
    42 NeuroSignals(NeuroImpl *n):owner(n),cr(0) {}
     45NeuroSignals(NeuroImpl *n):cr(0),owner(n) {}
    4346
    4447#define STATRICKCLASS NeuroSignals
     
    7477static double getStateFromNeuro(Neuro *n);
    7578int getErrorCount() {return errorcount;}
    76 NeuroNetImpl(Model& model, NeuroNetConfig& conf = NeuroNetConfig::getGlobalConfig()
     79NeuroNetConfig &getConfig() {return config;}
     80NeuroNetImpl(Model& model, NeuroNetConfig& conf
    7781#ifdef NEURO_SIGNALS
    7882, ChannelSpace *ch=0
     
    198202/** don't access directly */
    199203double newstate;
     204NeuroNetImpl *owner;
     205/** will be used by readParam() method, if not null  */
     206ParamEntry *paramentries; // no extra properties if ==0
    200207
    201208#ifdef NEURO_SIGNALS
    202209NeuroSignals sigs;
    203 #endif
    204 NeuroNetImpl *owner;
    205210ExtObject sigs_obj;
     211#endif
    206212
    207213/** "virtual constructor" - NeuroFactory uses this method to create the proper implementation object.
    208214    subclasses must return new object here. */
    209215virtual NeuroImpl* makeNew() {return 0;} //
    210 /** will be used by readParam() method, if not null  */
    211 ParamEntry *paramentries; // no extra properties if ==0
    212216/** read additional properties from "moredata" field of the originating Neuro */
    213217void readParam();
     
    247251void validateNeuroState(double& st) {if (st<=-1e10) st=-1e10; else if (st>1e10) st=1e10;}
    248252
    249 NeuroImpl():owner(0),neuro(0),newstate(0),paramentries(0),simorder(1),status(BeforeInit),channels(1),fields_param(0),fields_object(0)
     253NeuroImpl():simorder(1),channels(1),fields_param(0),fields_object(0),status(BeforeInit),neuro(0),newstate(0),owner(0),paramentries(0)
    250254#ifdef NEURO_SIGNALS
    251255,sigs(this),sigs_obj(&NeuroSignals::getStaticParam(),&sigs)
Note: See TracChangeset for help on using the changeset viewer.