Connections design

From Emergent

Jump to: navigation, search

New Connection Design in 4.0

The new connection is just a plain non-virtual non-ref-counted object, which is fully managed by a RecvCons owning object. This saves a lot on memory allocation and efficiency of traversing the objects.

Key changes:

  • Con_Group does not exist, and can usually be replaced with RecvCons (rarely SendCons -- you'll get a compiler err in any case.
  • recv.gp.size -> recv.size; send.gp.size -> send.size
  • size -> cons.size within RecvCons or SendCons
  • FOR_ITR_GP ->
    for(int g=0; g < un->recv.size; g++) {
      RecvCons* recv_gp = un->recv.FastEl(g);
      ...
    }
  • 'if(u->bias) bias->' -> 'if(u->bias.cons.size) u->bias.Cn(0)->' (bias is now a RecvCons, can also pass its addr to relevant conspec functions!)
Personal tools