本文整理汇总了C++中data类的典型用法代码示例。如果您正苦于以下问题:C++ data类的具体用法?C++ data怎么用?C++ data使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了data类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TODO
bool y::ldap::account::load(const data& d) {
_uidNumber.readFromLdap(d);
if(_uidNumber().get() == 0) {
return false;
}
for(int i = 0; i < d.elms("objectClass"); i++) {
if(d.getValue("objectClass", i) == "schoolPerson") {
_hasSchoolPersonClass = true;
break;
}
}
_uid .readFromLdap(d);
_dn .readFromLdap(d);
_cn .readFromLdap(d);
_sn .readFromLdap(d);
_fullName .readFromLdap(d);
_homeDir .readFromLdap(d);
_wisaID .readFromLdap(d);
_wisaName .readFromLdap(d);
_mail .readFromLdap(d);
_mailAlias .readFromLdap(d);
_birthDay .readFromLdap(d);
_password .readFromLdap(d);
_role .readFromLdap(d);
_groupID .readFromLdap(d);
_schoolClass .readFromLdap(d);
_classChange .readFromLdap(d);
_birthPlace .readFromLdap(d);
_gender .readFromLdap(d);
_adminGroup .readFromLdap(d);
_registerID .readFromLdap(d);
_nationality .readFromLdap(d);
_stemID .readFromLdap(d);
_schoolID .readFromLdap(d);
_houseNumber .readFromLdap(d);
_houseNumberAdd.readFromLdap(d);
_city .readFromLdap(d);
_postalCode .readFromLdap(d);
_street .readFromLdap(d);
_country .readFromLdap(d);
if(_role().get() == ROLE::NONE) {
y::utils::Log().add("a user exists without a valid schoolrole: ");
y::utils::Log().add(_dn().get());
}
if(d.getValue("krbName" ).size()) _hasKrbName = true;
TODO(this can be removed later)
if(_fullName().get() == "System User") {
string fn = _cn().get();
fn += " ";
fn += _sn().get();
_fullName(FULL_NAME(fn), false);
}
_new = false;
return !_new;
}
示例2: strcmp
bool operator< (const data& d1, const data& d2)
{
// return true if d1 is "less than" d2, false otherwise
return strcmp(d1.getName(), d2.getName()) < 0;
}
示例3: strcpy
data::data(const data & aData)
{
char tempName[100];
char tempPhone[100];
char tempProduct[100];
char tempEvents[100];
aData.getName(tempName);
this->name = new char[strlen(tempName) + 1];
strcpy(name, tempName);
aData.getPhone(tempPhone);
this->phone = new char[strlen(tempPhone) + 1];
strcpy(phone, tempPhone);
aData.getProduct(tempProduct);
this->product = new char[strlen(tempProduct) + 1];
strcpy(product, tempProduct);
aData.getEvents(tempEvents);
this->events = new char [strlen(tempEvents) + 1];
strcpy(events, tempEvents);
}
示例4: Serialize
void Serialize(Archive& ar, const unsigned int /* version */)
{
using data::CreateNVP;
ar & CreateNVP(normalNodeMaxNumChildren, "normalNodeMaxNumChildren");
ar & CreateNVP(splitHistory, "splitHistory");
}
示例5:
data::data(data& h)
{
this->address = h.getAddress();
this->features = h.getFeatures();
this->sqFeet = h.getSqFeet();
this->bedrooms = h.getBedrooms();
this->bathrooms = h.getBathrooms();
}
示例6: Model
AuthorsBooks::AuthorsBooks(data attributes): Model("AuthorsBooks")
{
data::iterator iterator;
for (iterator = attributes.begin(); iterator != attributes.end(); iterator++)
{
modelData[iterator->first] = iterator->second;
}
}
示例7: Serialize
void Serialize(Archive& ar, const unsigned int /* version */)
{
using data::CreateNVP;
ar & CreateNVP(firstBound, "firstBound");
ar & CreateNVP(secondBound, "secondBound");
ar & CreateNVP(bound, "bound");
ar & CreateNVP(lastDistance, "lastDistance");
}
示例8: CreateNVP
void DrusillaSelect<MatType>::Serialize(Archive& ar,
const unsigned int /* version */)
{
using data::CreateNVP;
ar & CreateNVP(candidateSet, "candidateSet");
ar & CreateNVP(candidateIndices, "candidateIndices");
ar & CreateNVP(l, "l");
ar & CreateNVP(m, "m");
}
示例9: CreateNVP
void EMFit<InitialClusteringType, CovarianceConstraintPolicy>::Serialize(
Archive& ar,
const unsigned int /* version */)
{
using data::CreateNVP;
ar & CreateNVP(maxIterations, "maxIterations");
ar & CreateNVP(tolerance, "tolerance");
ar & CreateNVP(clusterer, "clusterer");
ar & CreateNVP(constraint, "constraint");
}
示例10: Serialize
void Serialize(Archive& ar, const unsigned int /* version */)
{
using data::CreateNVP;
// We just need to serialize each of the members.
ar & CreateNVP(mean, "mean");
ar & CreateNVP(covariance, "covariance");
ar & CreateNVP(covLower, "covLower");
ar & CreateNVP(invCov, "invCov");
ar & CreateNVP(logDetCov, "logDetCov");
}
示例11: Serialize
void CF::Serialize(Archive& ar, const unsigned int /* version */)
{
// This model is simple; just serialize all the members. No special handling
// required.
using data::CreateNVP;
ar & CreateNVP(numUsersForSimilarity, "numUsersForSimilarity");
ar & CreateNVP(rank, "rank");
ar & CreateNVP(w, "w");
ar & CreateNVP(h, "h");
ar & CreateNVP(cleanedData, "cleanedData");
}
示例12:
bool operator< (const data & aData1, const data & aData2)
{
char name1[100];
char name2[100];
aData1.getName(name1);
aData2.getName(name2);
if (strcmp(name1, name2) == -1)
return true;
else
return false;
}
示例13: CreateNVP
void DecisionStump<MatType>::Serialize(Archive& ar,
const unsigned int /* version */)
{
using data::CreateNVP;
// This is straightforward; just serialize all of the members of the class.
// None need special handling.
ar & CreateNVP(classes, "classes");
ar & CreateNVP(bucketSize, "bucketSize");
ar & CreateNVP(splitDimension, "splitDimension");
ar & CreateNVP(split, "split");
ar & CreateNVP(binLabels, "binLabels");
}
示例14: fast_proj
animator_type fast_proj(const data& d, const solver_type& solver, const force_type& f, const math::natural& steps) {
return [&d, solver,f, &steps](math::real t, math::real dt) {
// projections
dof::velocity last;
dof::velocity v;
phys::solver::task task(v);
phys::constraint::bilateral::vector lambda;
task.lambda = λ
task.momentum = d.momentum( f(t, dt), dt );
for(math::natural i = 0; i < steps; ++i) {
// generates solver and evaluates constraints
auto s = solver();
task.bilateral =
(1/dt) * d.system.constraint.bilateral.corrections + d.system.constraint.bilateral.matrix * v
;
s.solve( task );
// muhahahaha
d.engine.correct( (0.5 * dt ) * (v - last) );
task.momentum = d.system.mass * v;
last = v;
}
d.engine.set(v, d.system.mass * v);
};
}
示例15: insert
void hashTree::insert(treeNode*& root, data& aData)
{
char key[100];
char compare[100];
if (root)
{
root->item->getName(compare);
aData.getName(key);
}
if(!root)
{
root = new treeNode(&aData);
size++;
}
else if(strcmp(key, compare) < 0)
{
insert(root->left, aData);
}
else
{
insert(root->right, aData);
}
}