Exemplo n.º 1
0
        //void deallocate();

        //      int add_compute(const string, int);
        //int add_fix(const string);
        //      int add_surf_collide(const string);
        //      int add_surf_react(const string);
        //      int add_variable(const string);

        //      typedef void (Stats::* FnPtr) ();
        void addfield(string key, ComputeHandler func, int typeflag)
        {
            keyword[nfield] = string.Copy(key);
            vfunc[nfield]   = func;
            vtype[nfield]   = typeflag;
            nfield++;
        }
Exemplo n.º 2
0
        int[] variables;           // list of Variable indices



        // private methods

        void Allocate()
        {
            int n = nfield;

            keyword = new string[n];

            vfunc = new ComputeHandler[n];
            vtype = new int[n];

            format             = new string[n];
            format_column_user = new string[n];
            for (int i = 0; i < n; i++)
            {
                format_column_user[i] = null;
            }

            field2index = new int[n];
            argindex1   = new int[n];
            argindex2   = new int[n];

            // memory for computes, fixes, variables

            ncompute      = 0;
            id_compute    = new string[n];
            compute_which = new int[n];
            computes      = new List <Compute>(n);

            nfix   = 0;
            id_fix = new string[n];
            fixes  = new List <Fix>(n);

            nsurfcollide    = 0;
            id_surf_collide = new string[n];
            sc = new List <SurfCollide>(n);

            nsurfreact    = 0;
            id_surf_react = new string[n];
            sr            = new List <SurfReact>(n);

            nvariable   = 0;
            id_variable = new string[n];
            variables   = new int[n];
        }