Ejemplo n.º 1
0
void FingerTable::clearSuccList() 
{
	ChordId EmptyId ;
	for(int i = 0 ; i < NSUCCLIST ; i++)
	{
		setSuccessor(i,EmptyId) ;
	}
}
Ejemplo n.º 2
0
MDUnitFactory_uptr makeMDUnitFactoryChain() {
  typedef MDUnitFactory_uptr FactoryType;
  auto first = FactoryType(new InverseAngstromsUnitFactory);
  first->setSuccessor(FactoryType(new ReciprocalLatticeUnitFactory))
   // Add more factories here! 
   // Make sure that LabelUnitFactory is the last in the chain to give a fall through
    .setSuccessor(FactoryType(new LabelUnitFactory));
  return first;
}
Ejemplo n.º 3
0
// ----------------------------------------------------------------------------
///  Bracket
// ----------------------------------------------------------------------------
PatMat::PatElmt_* PatMat::bracket(PatElmt_* e, PatElmt_* p, PatElmt_* a)
{
    if (p == EOP)
    {
        e->pNext_ = a;
        e->index_ = 2;
        a->index_ = 1;
    }
    else
    {
        e->pNext_ = p;
        setSuccessor(p, a);
        e->index_ = p->index_ + 2;
        a->index_ = p->index_ + 1;
    }

    return e;
}
/**
 * Create a MantidMatrix Tab Extension
 * @param type: provide the type
 * @returns a MantidMatrixTabeExtension
 */
MantidMatrixTabExtension
MantidMatrixExtensionRequest::createMantidMatrixTabExtension(
    MantidMatrixModel::Type type) {
  MantidMatrixTabExtension extension;

  switch (type) {
  case MantidMatrixModel::DX: {
    extension.label = "X Errors";
    extension.type = type;
    // Extend the chain of responsibility
    auto dxHandler =
        Mantid::Kernel::make_unique<MantidMatrixDxExtensionHandler>();
    dxHandler->setSuccessor(m_extensionHandler);
    m_extensionHandler = std::move(dxHandler);
    return extension;
  }
  default:
    throw std::runtime_error(
        "The requested extension type has not been implemented yet");
  }
}
Ejemplo n.º 5
0
// ----------------------------------------------------------------------------
///  Arbno
// ----------------------------------------------------------------------------
PatMat::PatElmt_* PatMat::arbnoSimple(const PatElmt_* p)
{
    PatElmt_* s = new PatElmt_(PC_Arbno_S, p->index_ + 1, EOP, p);
    setSuccessor(p, s);
    return s;
}