本文整理汇总了C++中Sink类的典型用法代码示例。如果您正苦于以下问题:C++ Sink类的具体用法?C++ Sink怎么用?C++ Sink使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Sink类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: qCreateSink
unsigned qCreateSink(void)
{
Sink *sink = new Sink();
if (!sink) {
qLog() << "qCreateSink(): failed to instantiate new sink" << flush;
return 0;
}
g_Ticker.addTickee(sink->ptr());
return sink->key();
}
示例2: write
void Dict::write(Sink &sink) const {
sink.beginDict(isSimple());
for (const_iterator it = begin(); it != end(); it++) {
if (!it->second->canWrite(sink)) continue;
sink.beginInsert(it->first);
it->second->write(sink);
}
sink.endDict();
}
示例3: _UnixDo
void _UnixDo(Source & so,Sink & si) {
stringGB s;
so >> s;
so.shouldBeEnd();
si.noOutput();
system(s.value().chars());
};
示例4: _SetWreathOrder
void _SetWreathOrder(Source & so,Sink & si) {
stringGB name;
list<stringGB> L;
so >> name;
GBInputSpecial(L,so);
T * p = Name2Instance<AdmissibleOrder>::s_find(name);
if(!p) {
vector<vector<Variable> > VARS;
vector<AdmissibleOrder *> ORDS;
typedef list<stringGB>::const_iterator LI;
LI w = L.begin(), e = L.end();
AdmissibleOrder * q;
while(w!=e) {
q = Name2Instance<AdmissibleOrder>::s_find((*w).value());
ORDS.push_back(q);
++w;
};
DBG();
p = new WreathOrder(VARS,ORDS);
Name2Instance<AdmissibleOrder>::s_add(name,p);
};
GBInput(*p,so);
so.shouldBeEnd();
si.noOutput();
};
示例5: copy_impl
std::streamsize copy_impl( Source& src, Sink& snk,
std::streamsize buffer_size,
mpl::false_, mpl::true_ )
{
typedef typename char_type_of<Source>::type char_type;
typedef std::pair<char_type*, char_type*> pair_type;
detail::basic_buffer<char_type> buf(buffer_size);
pair_type p = snk.output_sequence();
std::streamsize total = 0;
std::ptrdiff_t capacity = p.second - p.first;
while (true) {
std::streamsize amt =
iostreams::read(
src,
buf.data(),
buffer_size < capacity - total ?
buffer_size :
static_cast<std::streamsize>(capacity - total)
);
if (amt == -1)
break;
std::copy(buf.data(), buf.data() + amt, p.first + total);
total += amt;
}
return total;
}
示例6: _GroebnerCutOffSum
void _GroebnerCutOffSum(Source & so,Sink & si) {
int n;
so >> n;
so.shouldBeEnd();
si.noOutput();
run->setSumNumberCutOff(n);
};
示例7: _GroebnerCutOffFlag
void _GroebnerCutOffFlag(Source & so,Sink & si) {
int n;
so >> n;
so.shouldBeEnd();
run->setCutOffFlag(n!=0);
si.noOutput();
};
示例8: Dump_
void CollectionLinkHeaderItem::Dump_(Sink& sink) const
{
Header hdr{};
hdr.offset = ToFilePos(data->ptr);
hdr.count = data->ptr.As0<CollectionLinkItem>().entries.size();
sink.WriteGen(hdr);
}
示例9: add_slot
void add_slot(Sink& aSink, SinkFunction aSinkFunction)
{
typename LockingPolicy::scope_lock sl(*this);
if (slots().find(&aSink) != slots().end())
throw slot_already_added();
detail::do_bind<ParameterCount>()(aSink, aSinkFunction, slots()[&aSink]);
aSink.signal_created(*this);
}
示例10: main
int main(void)
{
File *aviFile = new File();
Demux *aviDemux = new Demux();
Codec *h264 = new Codec();
Sink *imageSink = new Sink();
Component *com = new Component();
aviDemux->setProcessComponent(aviFile);
h264->setProcessComponent(aviDemux);
com->setProcessComponent(h264);
imageSink->setProcessComponent(com);
imageSink->dataProcess(NULL, NULL);
return 0;
}
示例11: sink
void OutputVisitor::s_put(const tRational<LINTEGER> & x,Sink & si) {
if(x.denominator().zero()) {
si << x.numerator().internal();
} else {
Sink sink(si.outputFunction("Divide",2L));
sink << x.numerator().internal() << x.denominator().internal();
};
};
示例12: _RunGBAlg
void _RunGBAlg(Source & source,Sink & sink) {
asStringGB name;
source >> name;
source.shouldBeEnd();
sink.noOutput();
GBALG_STORAGE::const_iterator w = gbalg_storage.find(name.value());
if(w==gbalg_storage.end()) DBG();
(*w).second->perform();
};
示例13: Serialize
void Serialize(Sink & sink)
{
SortPostings();
BuildDictionary();
TextIndexHeader header;
uint64_t const startPos = sink.Pos();
// Will be filled in later.
header.Serialize(sink);
SerializeDictionary(sink, header, startPos);
SerializePostingsLists(sink, header, startPos);
uint64_t const finishPos = sink.Pos();
sink.Seek(startPos);
header.Serialize(sink);
sink.Seek(finishPos);
}
示例14: _CppTeXTheFile
void _CppTeXTheFile(Source & so,Sink & si) {
stringGB format;
so >> format;
StringAccumulator x;
x.add(PlatformSpecific::s_latex_command());
x.add(format.value().chars());
so.shouldBeEnd();
si.noOutput();
system(x.chars());
};
示例15: _ShowTeX
void _ShowTeX(Source & so,Sink & si) {
stringGB format;
so >> format;
StringAccumulator x;
x.add(PlatformSpecific::s_dvi_viewer());
x.add(format.value().chars());
x.add(PlatformSpecific::s_background());
so.shouldBeEnd();
si.noOutput();
system(x.chars());
};