prompt
large_stringlengths 70
991k
| completion
large_stringlengths 0
1.02k
|
---|---|
<|file_name|>middles.go<|end_file_name|><|fim▁begin|><|fim▁hole|>)
// DataSender send all languages and current language to view template.
func DataSender(a *orivil.App) {
if filter, ok := a.Get(orivil.SvcI18nFilter).(*Filter); ok {
currentLang := GetFullName(filter.currentLang)
a.With("currentLang", currentLang)
a.With("i18nlangs", Config.Languages)
}
}<|fim▁end|> | package i18n
import (
"gopkg.in/orivil/orivil.v1" |
<|file_name|>artnet-server.py<|end_file_name|><|fim▁begin|>from artnet import *
import SocketServer
import time, os, random, datetime, sys
import argparse<|fim▁hole|>
DEBUG = False
UDP_IP = "2.0.0.61"
UDP_PORT = 6454<|fim▁end|> | import socket
import struct
from subprocess import Popen, PIPE, STDOUT
import glob |
<|file_name|>trip-details.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
/*<|fim▁hole|>
See http://ionicframework.com/docs/v2/components/#navigation for more info on
Ionic pages and navigation.
*/
@Component({
selector: 'page-trip-details',
templateUrl: 'trip-details.html'
})
export class TripDetailsPage {
tripObject: any;
name;
price;
addressFrom;
addressTo;
description;
nbParticipers;
userOrganizerName;
userOrganizerPhone;
nbInsiders;
constructor(public navCtrl: NavController, private navParams: NavParams) {
this.tripObject = navParams.get('tripObjectSend');
this.name = this.tripObject['name'];
this.price = this.tripObject['price'];
this.addressFrom = this.tripObject['address-from'];
this.addressTo = this.tripObject['address-to'];
this.description = this.tripObject['description'];
this.nbParticipers = this.tripObject['number-participers'];
this.userOrganizerName = this.tripObject['user-organizer']['name'];
this.userOrganizerPhone = this.tripObject['user-organizer']['phone-number'];
this.nbInsiders = this.tripObject['number-insiders'];
}
ionViewDidLoad() {
console.log('Hello TripDetailsPage Page');
}
}<|fim▁end|> | Generated class for the TripDetails page. |
<|file_name|>CameraLatency.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.camera.stress;
import com.android.camera.CameraActivity;
import android.app.Instrumentation;
import android.content.Intent;
import android.os.Environment;
import android.provider.MediaStore;
import android.test.ActivityInstrumentationTestCase2;
import android.test.suitebuilder.annotation.LargeTest;
import android.util.Log;
import android.view.KeyEvent;
import java.io.BufferedWriter;
import java.io.FileWriter;
/**
* Junit / Instrumentation test case for camera test
*
*/
public class CameraLatency extends ActivityInstrumentationTestCase2 <CameraActivity> {
private String TAG = "CameraLatency";
private static final int TOTAL_NUMBER_OF_IMAGECAPTURE = 20;
private static final long WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN = 4000;
private static final String CAMERA_TEST_OUTPUT_FILE =
Environment.getExternalStorageDirectory().toString() + "/mediaStressOut.txt";
private long mTotalAutoFocusTime;
private long mTotalShutterLag;
private long mTotalShutterToPictureDisplayedTime;
private long mTotalPictureDisplayedToJpegCallbackTime;
private long mTotalJpegCallbackFinishTime;
private long mTotalFirstPreviewTime;
private long mAvgAutoFocusTime;
private long mAvgShutterLag = mTotalShutterLag;
private long mAvgShutterToPictureDisplayedTime;
private long mAvgPictureDisplayedToJpegCallbackTime;
private long mAvgJpegCallbackFinishTime;
private long mAvgFirstPreviewTime;
public CameraLatency() {
super(CameraActivity.class);
}
@Override
protected void setUp() throws Exception {
// Make sure camera starts with still picture capturing mode
Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setClass(getInstrumentation().getTargetContext(),
CameraActivity.class);
setActivityIntent(intent);
getActivity();
super.setUp();
}
@Override
protected void tearDown() throws Exception {
super.tearDown();
}
public void testImageCapture() {
Log.v(TAG, "start testImageCapture test");
Instrumentation inst = getInstrumentation();
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_DOWN);
try {
for (int i = 0; i < TOTAL_NUMBER_OF_IMAGECAPTURE; i++) {
Thread.sleep(WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN);
inst.sendKeyDownUpSync(KeyEvent.KEYCODE_DPAD_CENTER);
Thread.sleep(WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN);<|fim▁hole|> if (i != 0) {
CameraActivity c = getActivity();
// if any of the latency var accessor methods return -1 then the
// camera is set to a different module other than PhotoModule so
// skip the shot and try again
if (c.getAutoFocusTime() != -1) {
mTotalAutoFocusTime += c.getAutoFocusTime();
mTotalShutterLag += c.getShutterLag();
mTotalShutterToPictureDisplayedTime +=
c.getShutterToPictureDisplayedTime();
mTotalPictureDisplayedToJpegCallbackTime +=
c.getPictureDisplayedToJpegCallbackTime();
mTotalJpegCallbackFinishTime += c.getJpegCallbackFinishTime();
mTotalFirstPreviewTime += c.getFirstPreviewTime();
}
else {
i--;
continue;
}
}
}
} catch (Exception e) {
Log.v(TAG, "Got exception", e);
}
//ToDO: yslau
//1) Need to get the baseline from the cupcake so that we can add the
//failure condition of the camera latency.
//2) Only count those number with succesful capture. Set the timer to invalid
//before capture and ignore them if the value is invalid
int numberofRun = TOTAL_NUMBER_OF_IMAGECAPTURE - 1;
mAvgAutoFocusTime = mTotalAutoFocusTime / numberofRun;
mAvgShutterLag = mTotalShutterLag / numberofRun;
mAvgShutterToPictureDisplayedTime =
mTotalShutterToPictureDisplayedTime / numberofRun;
mAvgPictureDisplayedToJpegCallbackTime =
mTotalPictureDisplayedToJpegCallbackTime / numberofRun;
mAvgJpegCallbackFinishTime =
mTotalJpegCallbackFinishTime / numberofRun;
mAvgFirstPreviewTime =
mTotalFirstPreviewTime / numberofRun;
try {
FileWriter fstream = null;
fstream = new FileWriter(CAMERA_TEST_OUTPUT_FILE, true);
BufferedWriter out = new BufferedWriter(fstream);
out.write("Camera Latency : \n");
out.write("Number of loop: " + TOTAL_NUMBER_OF_IMAGECAPTURE + "\n");
out.write("Avg AutoFocus = " + mAvgAutoFocusTime + "\n");
out.write("Avg mShutterLag = " + mAvgShutterLag + "\n");
out.write("Avg mShutterToPictureDisplayedTime = "
+ mAvgShutterToPictureDisplayedTime + "\n");
out.write("Avg mPictureDisplayedToJpegCallbackTime = "
+ mAvgPictureDisplayedToJpegCallbackTime + "\n");
out.write("Avg mJpegCallbackFinishTime = " +
mAvgJpegCallbackFinishTime + "\n");
out.write("Avg FirstPreviewTime = " +
mAvgFirstPreviewTime + "\n");
out.close();
fstream.close();
} catch (Exception e) {
fail("Camera Latency write output to file");
}
Log.v(TAG, "The Image capture wait time = " +
WAIT_FOR_IMAGE_CAPTURE_TO_BE_TAKEN);
Log.v(TAG, "Avg AutoFocus = " + mAvgAutoFocusTime);
Log.v(TAG, "Avg mShutterLag = " + mAvgShutterLag);
Log.v(TAG, "Avg mShutterToPictureDisplayedTime = "
+ mAvgShutterToPictureDisplayedTime);
Log.v(TAG, "Avg mPictureDisplayedToJpegCallbackTime = "
+ mAvgPictureDisplayedToJpegCallbackTime);
Log.v(TAG, "Avg mJpegCallbackFinishTime = " + mAvgJpegCallbackFinishTime);
Log.v(TAG, "Avg FirstPreviewTime = " + mAvgFirstPreviewTime);
}
}<|fim▁end|> | //skip the first measurement |
<|file_name|>Login.py<|end_file_name|><|fim▁begin|># !/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import urllib2
import cookielib
import base64
import re
import json
import hashlib
'''该登录程序是参考网上写的'''
cj = cookielib.LWPCookieJar()
cookie_support = urllib2.HTTPCookieProcessor(cj)
opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
urllib2.install_opener(opener)
postdata = {
'entry': 'weibo',
'gateway': '1',
'from': '',
'savestate': '7',
'userticket': '1',
'ssosimplelogin': '1',
'vsnf': '1',
'vsnval': '',
'su': '',
'service': 'miniblog',
'servertime': '',
'nonce': '',
'pwencode': 'wsse',
'sp': '',
'encoding': 'UTF-8',
'url': 'http://weibo.com/ajaxlogin.php?framelogin=1&callback=parent.sinaSSOController.feedBackUrlCallBack',
'returntype': 'META'
}
def get_servertime():
url = 'http://login.sina.com.cn/sso/prelogin.php?entry=weibo&callback=sinaSSOController.preloginCallBack&su=dW5kZWZpbmVk&client=ssologin.js(v1.3.18)&_=1329806375939'
data = urllib2.urlopen(url).read()
p = re.compile('\((.*)\)')
try:
json_data = p.search(data).group(1)
data = json.loads(json_data)
servertime = str(data['servertime'])
nonce = data['nonce']
return servertime, nonce
except:
print 'Get severtime error!'
return None
def get_pwd(pwd, servertime, nonce):
pwd1 = hashlib.sha1(pwd).hexdigest()
pwd2 = hashlib.sha1(pwd1).hexdigest()
pwd3_ = pwd2 + servertime + nonce
pwd3 = hashlib.sha1(pwd3_).hexdigest()
return pwd3
def get_user(username):
username_ = urllib.quote(username)
username = base64.encodestring(username_)[:-1]
return username
def enableCookie():
cookiejar = cookielib.LWPCookieJar()
cookie_support = urllib2.HTTPCookieProcessor(cookiejar)
opener = urllib2.build_opener(cookie_support, urllib2.HTTPHandler)
urllib2.install_opener(opener)
def login( username, pwd ):
url = 'http://login.sina.com.cn/sso/login.php?client=ssologin.js(v1.3.18)'<|fim▁hole|>
#enableCookie()
try:
servertime, nonce = get_servertime()
except:
return
global postdata
postdata['servertime'] = servertime
postdata['nonce'] = nonce
postdata['su'] = get_user(username)
postdata['sp'] = get_pwd(pwd, servertime, nonce)
postdata = urllib.urlencode(postdata)
headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20100101 Firefox/8.0'}
req = urllib2.Request(
url = url,
data = postdata,
headers = headers
)
result = urllib2.urlopen(req)
text = result.read()
p = re.compile('location\.replace\(\'(.*?)\'\)')
try:
login_url = p.search(text).group(1)
#print login_url
urllib2.urlopen(login_url)
print "Login success!"
return True
except:
print 'Login error!'
return False<|fim▁end|> | |
<|file_name|>modulegen__gcc_LP64.py<|end_file_name|><|fim▁begin|>from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
return True
pybindgen.settings.error_handler = ErrorHandler()
import sys
def module_init():
root_module = Module('ns.olsr', cpp_namespace='::ns3')
return root_module
def register_types(module):
root_module = module.get_root()
## address.h (module 'network'): ns3::Address [class]
module.add_class('Address', import_from_module='ns.network')
## address.h (module 'network'): ns3::Address::MaxSize_e [enumeration]
module.add_enum('MaxSize_e', ['MAX_SIZE'], outer_class=root_module['ns3::Address'], import_from_module='ns.network')
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList [class]
module.add_class('AttributeConstructionList', import_from_module='ns.core')
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item [struct]
module.add_class('Item', import_from_module='ns.core', outer_class=root_module['ns3::AttributeConstructionList'])
typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator', u'ns3::AttributeConstructionList::CIterator')
typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator*', u'ns3::AttributeConstructionList::CIterator*')
typehandlers.add_type_alias(u'std::list< ns3::AttributeConstructionList::Item > const_iterator&', u'ns3::AttributeConstructionList::CIterator&')
## buffer.h (module 'network'): ns3::Buffer [class]
module.add_class('Buffer', import_from_module='ns.network')
## buffer.h (module 'network'): ns3::Buffer::Iterator [class]
module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::Buffer'])
## packet.h (module 'network'): ns3::ByteTagIterator [class]
module.add_class('ByteTagIterator', import_from_module='ns.network')
## packet.h (module 'network'): ns3::ByteTagIterator::Item [class]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagIterator'])
## byte-tag-list.h (module 'network'): ns3::ByteTagList [class]
module.add_class('ByteTagList', import_from_module='ns.network')
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator [class]
module.add_class('Iterator', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList'])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item [struct]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::ByteTagList::Iterator'])
## callback.h (module 'core'): ns3::CallbackBase [class]
module.add_class('CallbackBase', import_from_module='ns.core')
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeChecker'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::AttributeValue'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::EventImpl'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::NixVector'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::Packet'])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor> [struct]
module.add_class('DefaultDeleter', import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor'])
## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector [class]
module.add_class('EventGarbageCollector', import_from_module='ns.core')
## event-id.h (module 'core'): ns3::EventId [class]
module.add_class('EventId', import_from_module='ns.core')
## hash.h (module 'core'): ns3::Hasher [class]
module.add_class('Hasher', import_from_module='ns.core')
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class]
module.add_class('Inet6SocketAddress', import_from_module='ns.network')
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress [class]
root_module['ns3::Inet6SocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class]
module.add_class('InetSocketAddress', import_from_module='ns.network')
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress [class]
root_module['ns3::InetSocketAddress'].implicitly_converts_to(root_module['ns3::Address'])
## int-to-type.h (module 'core'): ns3::IntToType<0> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['0'])
## int-to-type.h (module 'core'): ns3::IntToType<0>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 0 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<1> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['1'])
## int-to-type.h (module 'core'): ns3::IntToType<1>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 1 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<2> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['2'])
## int-to-type.h (module 'core'): ns3::IntToType<2>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 2 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<3> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['3'])
## int-to-type.h (module 'core'): ns3::IntToType<3>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 3 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<4> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['4'])
## int-to-type.h (module 'core'): ns3::IntToType<4>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 4 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<5> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['5'])
## int-to-type.h (module 'core'): ns3::IntToType<5>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 5 >'], import_from_module='ns.core')
## int-to-type.h (module 'core'): ns3::IntToType<6> [struct]
module.add_class('IntToType', import_from_module='ns.core', template_parameters=['6'])
## int-to-type.h (module 'core'): ns3::IntToType<6>::v_e [enumeration]
module.add_enum('v_e', ['value'], outer_class=root_module['ns3::IntToType< 6 >'], import_from_module='ns.core')
## ipv4-address.h (module 'network'): ns3::Ipv4Address [class]
module.add_class('Ipv4Address', import_from_module='ns.network')
## ipv4-address.h (module 'network'): ns3::Ipv4Address [class]
root_module['ns3::Ipv4Address'].implicitly_converts_to(root_module['ns3::Address'])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress [class]
module.add_class('Ipv4InterfaceAddress', import_from_module='ns.internet')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e [enumeration]
module.add_enum('InterfaceAddressScope_e', ['HOST', 'LINK', 'GLOBAL'], outer_class=root_module['ns3::Ipv4InterfaceAddress'], import_from_module='ns.internet')
## ipv4-address.h (module 'network'): ns3::Ipv4Mask [class]
module.add_class('Ipv4Mask', import_from_module='ns.network')
## ipv4-routing-helper.h (module 'internet'): ns3::Ipv4RoutingHelper [class]
module.add_class('Ipv4RoutingHelper', allow_subclassing=True, import_from_module='ns.internet')
## ipv6-address.h (module 'network'): ns3::Ipv6Address [class]
module.add_class('Ipv6Address', import_from_module='ns.network')
## ipv6-address.h (module 'network'): ns3::Ipv6Address [class]
root_module['ns3::Ipv6Address'].implicitly_converts_to(root_module['ns3::Address'])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix [class]
module.add_class('Ipv6Prefix', import_from_module='ns.network')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
module.add_class('Mac48Address', import_from_module='ns.network')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Mac48Address )', u'ns3::Mac48Address::TracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Mac48Address )*', u'ns3::Mac48Address::TracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Mac48Address )&', u'ns3::Mac48Address::TracedCallback&')
## mac48-address.h (module 'network'): ns3::Mac48Address [class]
root_module['ns3::Mac48Address'].implicitly_converts_to(root_module['ns3::Address'])
## mac8-address.h (module 'network'): ns3::Mac8Address [class]
module.add_class('Mac8Address', import_from_module='ns.network')
## mac8-address.h (module 'network'): ns3::Mac8Address [class]
root_module['ns3::Mac8Address'].implicitly_converts_to(root_module['ns3::Address'])
## node-container.h (module 'network'): ns3::NodeContainer [class]
module.add_class('NodeContainer', import_from_module='ns.network')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator', u'ns3::NodeContainer::Iterator')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator*', u'ns3::NodeContainer::Iterator*')
typehandlers.add_type_alias(u'std::vector< ns3::Ptr< ns3::Node > > const_iterator&', u'ns3::NodeContainer::Iterator&')
## non-copyable.h (module 'core'): ns3::NonCopyable [class]
module.add_class('NonCopyable', destructor_visibility='protected', import_from_module='ns.core')
## object-base.h (module 'core'): ns3::ObjectBase [class]
module.add_class('ObjectBase', allow_subclassing=True, import_from_module='ns.core')
## object.h (module 'core'): ns3::ObjectDeleter [struct]
module.add_class('ObjectDeleter', import_from_module='ns.core')
## object-factory.h (module 'core'): ns3::ObjectFactory [class]
module.add_class('ObjectFactory', import_from_module='ns.core')
## olsr-helper.h (module 'olsr'): ns3::OlsrHelper [class]
module.add_class('OlsrHelper', parent=root_module['ns3::Ipv4RoutingHelper'])
## packet-metadata.h (module 'network'): ns3::PacketMetadata [class]
module.add_class('PacketMetadata', import_from_module='ns.network')
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item [struct]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata'])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::ItemType [enumeration]
module.add_enum('ItemType', ['PAYLOAD', 'HEADER', 'TRAILER'], outer_class=root_module['ns3::PacketMetadata::Item'], import_from_module='ns.network')
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator [class]
module.add_class('ItemIterator', import_from_module='ns.network', outer_class=root_module['ns3::PacketMetadata'])
## packet.h (module 'network'): ns3::PacketTagIterator [class]
module.add_class('PacketTagIterator', import_from_module='ns.network')
## packet.h (module 'network'): ns3::PacketTagIterator::Item [class]
module.add_class('Item', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagIterator'])
## packet-tag-list.h (module 'network'): ns3::PacketTagList [class]
module.add_class('PacketTagList', import_from_module='ns.network')
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData [struct]
module.add_class('TagData', import_from_module='ns.network', outer_class=root_module['ns3::PacketTagList'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Object', 'ns3::ObjectBase', 'ns3::ObjectDeleter'], parent=root_module['ns3::ObjectBase'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simulator.h (module 'core'): ns3::Simulator [class]
module.add_class('Simulator', destructor_visibility='private', import_from_module='ns.core')
## simulator.h (module 'core'): ns3::Simulator [enumeration]
module.add_enum('', ['NO_CONTEXT'], outer_class=root_module['ns3::Simulator'], import_from_module='ns.core')
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs [class]
module.add_class('SystemWallClockMs', import_from_module='ns.core')
## tag.h (module 'network'): ns3::Tag [class]
module.add_class('Tag', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
## tag-buffer.h (module 'network'): ns3::TagBuffer [class]
module.add_class('TagBuffer', import_from_module='ns.network')
## nstime.h (module 'core'): ns3::TimeWithUnit [class]
module.add_class('TimeWithUnit', import_from_module='ns.core')
## timer.h (module 'core'): ns3::Timer [class]
module.add_class('Timer', import_from_module='ns.core')
## timer.h (module 'core'): ns3::Timer::DestroyPolicy [enumeration]
module.add_enum('DestroyPolicy', ['CANCEL_ON_DESTROY', 'REMOVE_ON_DESTROY', 'CHECK_ON_DESTROY'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core')
## timer.h (module 'core'): ns3::Timer::State [enumeration]
module.add_enum('State', ['RUNNING', 'EXPIRED', 'SUSPENDED'], outer_class=root_module['ns3::Timer'], import_from_module='ns.core')
## timer-impl.h (module 'core'): ns3::TimerImpl [class]
module.add_class('TimerImpl', allow_subclassing=True, import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId [class]
module.add_class('TypeId', import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::AttributeFlag [enumeration]
module.add_enum('AttributeFlag', ['ATTR_GET', 'ATTR_SET', 'ATTR_CONSTRUCT', 'ATTR_SGC'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::SupportLevel [enumeration]
module.add_enum('SupportLevel', ['SUPPORTED', 'DEPRECATED', 'OBSOLETE'], outer_class=root_module['ns3::TypeId'], import_from_module='ns.core')
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation [struct]
module.add_class('AttributeInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId'])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation [struct]
module.add_class('TraceSourceInformation', import_from_module='ns.core', outer_class=root_module['ns3::TypeId'])
typehandlers.add_type_alias(u'uint32_t', u'ns3::TypeId::hash_t')
typehandlers.add_type_alias(u'uint32_t*', u'ns3::TypeId::hash_t*')
typehandlers.add_type_alias(u'uint32_t&', u'ns3::TypeId::hash_t&')
## empty.h (module 'core'): ns3::empty [class]
module.add_class('empty', import_from_module='ns.core')
## int64x64-128.h (module 'core'): ns3::int64x64_t [class]
module.add_class('int64x64_t', import_from_module='ns.core')
## int64x64-128.h (module 'core'): ns3::int64x64_t::impl_type [enumeration]
module.add_enum('impl_type', ['int128_impl', 'cairo_impl', 'ld_impl'], outer_class=root_module['ns3::int64x64_t'], import_from_module='ns.core')
## chunk.h (module 'network'): ns3::Chunk [class]
module.add_class('Chunk', import_from_module='ns.network', parent=root_module['ns3::ObjectBase'])
## header.h (module 'network'): ns3::Header [class]
module.add_class('Header', import_from_module='ns.network', parent=root_module['ns3::Chunk'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header [class]
module.add_class('Ipv4Header', import_from_module='ns.internet', parent=root_module['ns3::Header'])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType [enumeration]
module.add_enum('DscpType', ['DscpDefault', 'DSCP_CS1', 'DSCP_AF11', 'DSCP_AF12', 'DSCP_AF13', 'DSCP_CS2', 'DSCP_AF21', 'DSCP_AF22', 'DSCP_AF23', 'DSCP_CS3', 'DSCP_AF31', 'DSCP_AF32', 'DSCP_AF33', 'DSCP_CS4', 'DSCP_AF41', 'DSCP_AF42', 'DSCP_AF43', 'DSCP_CS5', 'DSCP_EF', 'DSCP_CS6', 'DSCP_CS7'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet')
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::EcnType [enumeration]
module.add_enum('EcnType', ['ECN_NotECT', 'ECN_ECT1', 'ECN_ECT0', 'ECN_CE'], outer_class=root_module['ns3::Ipv4Header'], import_from_module='ns.internet')
## object.h (module 'core'): ns3::Object [class]
module.add_class('Object', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
## object.h (module 'core'): ns3::Object::AggregateIterator [class]
module.add_class('AggregateIterator', import_from_module='ns.core', outer_class=root_module['ns3::Object'])
## random-variable-stream.h (module 'core'): ns3::RandomVariableStream [class]
module.add_class('RandomVariableStream', import_from_module='ns.core', parent=root_module['ns3::Object'])
## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable [class]
module.add_class('SequentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeChecker', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeChecker>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::AttributeValue', 'ns3::empty', 'ns3::DefaultDeleter<ns3::AttributeValue>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::CallbackImplBase', 'ns3::empty', 'ns3::DefaultDeleter<ns3::CallbackImplBase>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::EventImpl', 'ns3::empty', 'ns3::DefaultDeleter<ns3::EventImpl>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Hash::Implementation', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Hash::Implementation>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Ipv4MulticastRoute', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4MulticastRoute>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Ipv4Route', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Ipv4Route>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::NixVector', 'ns3::empty', 'ns3::DefaultDeleter<ns3::NixVector>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::OutputStreamWrapper', 'ns3::empty', 'ns3::DefaultDeleter<ns3::OutputStreamWrapper>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::Packet', 'ns3::empty', 'ns3::DefaultDeleter<ns3::Packet>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > [class]
module.add_class('SimpleRefCount', automatic_type_narrowing=True, import_from_module='ns.core', template_parameters=['ns3::TraceSourceAccessor', 'ns3::empty', 'ns3::DefaultDeleter<ns3::TraceSourceAccessor>'], parent=root_module['ns3::empty'], memory_policy=cppclass.ReferenceCountingMethodsPolicy(incref_method='Ref', decref_method='Unref', peekref_method='GetReferenceCount'))
## socket.h (module 'network'): ns3::Socket [class]
module.add_class('Socket', import_from_module='ns.network', parent=root_module['ns3::Object'])
## socket.h (module 'network'): ns3::Socket::SocketErrno [enumeration]
module.add_enum('SocketErrno', ['ERROR_NOTERROR', 'ERROR_ISCONN', 'ERROR_NOTCONN', 'ERROR_MSGSIZE', 'ERROR_AGAIN', 'ERROR_SHUTDOWN', 'ERROR_OPNOTSUPP', 'ERROR_AFNOSUPPORT', 'ERROR_INVAL', 'ERROR_BADF', 'ERROR_NOROUTETOHOST', 'ERROR_NODEV', 'ERROR_ADDRNOTAVAIL', 'ERROR_ADDRINUSE', 'SOCKET_ERRNO_LAST'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::Socket::SocketType [enumeration]
module.add_enum('SocketType', ['NS3_SOCK_STREAM', 'NS3_SOCK_SEQPACKET', 'NS3_SOCK_DGRAM', 'NS3_SOCK_RAW'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::Socket::SocketPriority [enumeration]
module.add_enum('SocketPriority', ['NS3_PRIO_BESTEFFORT', 'NS3_PRIO_FILLER', 'NS3_PRIO_BULK', 'NS3_PRIO_INTERACTIVE_BULK', 'NS3_PRIO_INTERACTIVE', 'NS3_PRIO_CONTROL'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::Socket::Ipv6MulticastFilterMode [enumeration]
module.add_enum('Ipv6MulticastFilterMode', ['INCLUDE', 'EXCLUDE'], outer_class=root_module['ns3::Socket'], import_from_module='ns.network')
## socket.h (module 'network'): ns3::SocketIpTosTag [class]
module.add_class('SocketIpTosTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpTtlTag [class]
module.add_class('SocketIpTtlTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag [class]
module.add_class('SocketIpv6HopLimitTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketIpv6TclassTag [class]
module.add_class('SocketIpv6TclassTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketPriorityTag [class]
module.add_class('SocketPriorityTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag [class]
module.add_class('SocketSetDontFragmentTag', import_from_module='ns.network', parent=root_module['ns3::Tag'])
## nstime.h (module 'core'): ns3::Time [class]
module.add_class('Time', import_from_module='ns.core')
## nstime.h (module 'core'): ns3::Time::Unit [enumeration]
module.add_enum('Unit', ['Y', 'D', 'H', 'MIN', 'S', 'MS', 'US', 'NS', 'PS', 'FS', 'LAST'], outer_class=root_module['ns3::Time'], import_from_module='ns.core')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time )', u'ns3::Time::TracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time )*', u'ns3::Time::TracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time )&', u'ns3::Time::TracedCallback&')
## nstime.h (module 'core'): ns3::Time [class]
root_module['ns3::Time'].implicitly_converts_to(root_module['ns3::int64x64_t'])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor [class]
module.add_class('TraceSourceAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
## trailer.h (module 'network'): ns3::Trailer [class]
module.add_class('Trailer', import_from_module='ns.network', parent=root_module['ns3::Chunk'])
## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable [class]
module.add_class('TriangularRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable [class]
module.add_class('UniformRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable [class]
module.add_class('WeibullRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable [class]
module.add_class('ZetaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable [class]
module.add_class('ZipfRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## attribute.h (module 'core'): ns3::AttributeAccessor [class]
module.add_class('AttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
## attribute.h (module 'core'): ns3::AttributeChecker [class]
module.add_class('AttributeChecker', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
## attribute.h (module 'core'): ns3::AttributeValue [class]
module.add_class('AttributeValue', allow_subclassing=False, automatic_type_narrowing=True, import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
## callback.h (module 'core'): ns3::CallbackChecker [class]
module.add_class('CallbackChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## callback.h (module 'core'): ns3::CallbackImplBase [class]
module.add_class('CallbackImplBase', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])
## callback.h (module 'core'): ns3::CallbackValue [class]
module.add_class('CallbackValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable [class]
module.add_class('ConstantRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable [class]
module.add_class('DeterministicRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable [class]
module.add_class('EmpiricalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor [class]
module.add_class('EmptyAttributeAccessor', import_from_module='ns.core', parent=root_module['ns3::AttributeAccessor'])
## attribute.h (module 'core'): ns3::EmptyAttributeChecker [class]
module.add_class('EmptyAttributeChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## attribute.h (module 'core'): ns3::EmptyAttributeValue [class]
module.add_class('EmptyAttributeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable [class]
module.add_class('ErlangRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## event-impl.h (module 'core'): ns3::EventImpl [class]
module.add_class('EventImpl', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable [class]
module.add_class('ExponentialRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable [class]
module.add_class('GammaRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## ipv4.h (module 'internet'): ns3::Ipv4 [class]
module.add_class('Ipv4', import_from_module='ns.internet', parent=root_module['ns3::Object'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker [class]
module.add_class('Ipv4AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue [class]
module.add_class('Ipv4AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker [class]
module.add_class('Ipv4MaskChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue [class]
module.add_class('Ipv4MaskValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute [class]
module.add_class('Ipv4MulticastRoute', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >'])
## ipv4-route.h (module 'internet'): ns3::Ipv4Route [class]
module.add_class('Ipv4Route', import_from_module='ns.internet', parent=root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >'])
## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol [class]
module.add_class('Ipv4RoutingProtocol', import_from_module='ns.internet', parent=root_module['ns3::Object'])
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Ipv4RoutingProtocol::UnicastForwardCallback')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Ipv4RoutingProtocol::UnicastForwardCallback*')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Ipv4RoutingProtocol::UnicastForwardCallback&')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Ipv4RoutingProtocol::MulticastForwardCallback')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Ipv4RoutingProtocol::MulticastForwardCallback*')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Ipv4RoutingProtocol::MulticastForwardCallback&')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Ipv4RoutingProtocol::LocalDeliverCallback')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Ipv4RoutingProtocol::LocalDeliverCallback*')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Ipv4RoutingProtocol::LocalDeliverCallback&')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Ipv4RoutingProtocol::ErrorCallback')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Ipv4RoutingProtocol::ErrorCallback*')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Ipv4RoutingProtocol::ErrorCallback&')
## ipv4-static-routing.h (module 'internet'): ns3::Ipv4StaticRouting [class]
module.add_class('Ipv4StaticRouting', import_from_module='ns.internet', parent=root_module['ns3::Ipv4RoutingProtocol'])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker [class]
module.add_class('Ipv6AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue [class]
module.add_class('Ipv6AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker [class]
module.add_class('Ipv6PrefixChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue [class]
module.add_class('Ipv6PrefixValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable [class]
module.add_class('LogNormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker [class]
module.add_class('Mac48AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue [class]
module.add_class('Mac48AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## net-device.h (module 'network'): ns3::NetDevice [class]
module.add_class('NetDevice', import_from_module='ns.network', parent=root_module['ns3::Object'])
## net-device.h (module 'network'): ns3::NetDevice::PacketType [enumeration]
module.add_enum('PacketType', ['PACKET_HOST', 'NS3_PACKET_HOST', 'PACKET_BROADCAST', 'NS3_PACKET_BROADCAST', 'PACKET_MULTICAST', 'NS3_PACKET_MULTICAST', 'PACKET_OTHERHOST', 'NS3_PACKET_OTHERHOST'], outer_class=root_module['ns3::NetDevice'], import_from_module='ns.network')
typehandlers.add_type_alias(u'void ( * ) ( )', u'ns3::NetDevice::LinkChangeTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( )*', u'ns3::NetDevice::LinkChangeTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( )&', u'ns3::NetDevice::LinkChangeTracedCallback&')
typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::NetDevice::ReceiveCallback')
typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::NetDevice::ReceiveCallback*')
typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::NetDevice::ReceiveCallback&')
typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', u'ns3::NetDevice::PromiscReceiveCallback')
typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::NetDevice::PromiscReceiveCallback*')
typehandlers.add_type_alias(u'ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::NetDevice::PromiscReceiveCallback&')
## nix-vector.h (module 'network'): ns3::NixVector [class]
module.add_class('NixVector', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
## node.h (module 'network'): ns3::Node [class]
module.add_class('Node', import_from_module='ns.network', parent=root_module['ns3::Object'])
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Node::ProtocolHandler')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Node::ProtocolHandler*')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Node::ProtocolHandler&')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', u'ns3::Node::DeviceAdditionListener')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >*', u'ns3::Node::DeviceAdditionListener*')
typehandlers.add_type_alias(u'ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >&', u'ns3::Node::DeviceAdditionListener&')
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable [class]
module.add_class('NormalRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker [class]
module.add_class('ObjectFactoryChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue [class]
module.add_class('ObjectFactoryValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper [class]
module.add_class('OutputStreamWrapper', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
## packet.h (module 'network'): ns3::Packet [class]
module.add_class('Packet', import_from_module='ns.network', parent=root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > )', u'ns3::Packet::TracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > )*', u'ns3::Packet::TracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > )&', u'ns3::Packet::TracedCallback&')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )', u'ns3::Packet::AddressTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )*', u'ns3::Packet::AddressTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Address const & )&', u'ns3::Packet::AddressTracedCallback&')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )', u'ns3::Packet::TwoAddressTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )*', u'ns3::Packet::TwoAddressTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const > const, ns3::Address const &, ns3::Address const & )&', u'ns3::Packet::TwoAddressTracedCallback&')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )', u'ns3::Packet::Mac48AddressTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )*', u'ns3::Packet::Mac48AddressTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, ns3::Mac48Address )&', u'ns3::Packet::Mac48AddressTracedCallback&')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )', u'ns3::Packet::SizeTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )*', u'ns3::Packet::SizeTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t, uint32_t )&', u'ns3::Packet::SizeTracedCallback&')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, double )', u'ns3::Packet::SinrTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, double )*', u'ns3::Packet::SinrTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Ptr< ns3::Packet const >, double )&', u'ns3::Packet::SinrTracedCallback&')
## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable [class]
module.add_class('ParetoRandomVariable', import_from_module='ns.core', parent=root_module['ns3::RandomVariableStream'])
## nstime.h (module 'core'): ns3::TimeValue [class]
module.add_class('TimeValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## type-id.h (module 'core'): ns3::TypeIdChecker [class]
module.add_class('TypeIdChecker', import_from_module='ns.core', parent=root_module['ns3::AttributeChecker'])
## type-id.h (module 'core'): ns3::TypeIdValue [class]
module.add_class('TypeIdValue', import_from_module='ns.core', parent=root_module['ns3::AttributeValue'])
## address.h (module 'network'): ns3::AddressChecker [class]
module.add_class('AddressChecker', import_from_module='ns.network', parent=root_module['ns3::AttributeChecker'])
## address.h (module 'network'): ns3::AddressValue [class]
module.add_class('AddressValue', import_from_module='ns.network', parent=root_module['ns3::AttributeValue'])
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['bool', 'ns3::Ptr<ns3::Socket>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['ns3::ObjectBase *', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'const ns3::olsr::PacketHeader &', 'const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::Ptr<const ns3::Packet>', 'unsigned short', 'const ns3::Address &', 'const ns3::Address &', 'ns3::NetDevice::PacketType', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::NetDevice>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'const ns3::Address &', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'ns3::Ptr<ns3::Socket>', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## callback.h (module 'core'): ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> [class]
module.add_class('CallbackImpl', import_from_module='ns.core', template_parameters=['void', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], parent=root_module['ns3::CallbackImplBase'])
## ipv4-list-routing.h (module 'internet'): ns3::Ipv4ListRouting [class]
module.add_class('Ipv4ListRouting', import_from_module='ns.internet', parent=root_module['ns3::Ipv4RoutingProtocol'])
module.add_container('std::vector< ns3::Ipv6Address >', 'ns3::Ipv6Address', container_type=u'vector')
module.add_container('std::map< unsigned int, unsigned int >', ('unsigned int', 'unsigned int'), container_type=u'map')
module.add_container('std::vector< unsigned int >', 'unsigned int', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::MessageHeader >', 'ns3::olsr::MessageHeader', container_type=u'vector')
## Register a nested module for the namespace FatalImpl
nested_module = module.add_cpp_namespace('FatalImpl')
register_types_ns3_FatalImpl(nested_module)
## Register a nested module for the namespace Hash
nested_module = module.add_cpp_namespace('Hash')
register_types_ns3_Hash(nested_module)
## Register a nested module for the namespace TracedValueCallback
nested_module = module.add_cpp_namespace('TracedValueCallback')
register_types_ns3_TracedValueCallback(nested_module)
## Register a nested module for the namespace olsr
nested_module = module.add_cpp_namespace('olsr')
register_types_ns3_olsr(nested_module)
## Register a nested module for the namespace tests
nested_module = module.add_cpp_namespace('tests')
register_types_ns3_tests(nested_module)
def register_types_ns3_FatalImpl(module):
root_module = module.get_root()
def register_types_ns3_Hash(module):
root_module = module.get_root()
## hash-function.h (module 'core'): ns3::Hash::Implementation [class]
module.add_class('Implementation', import_from_module='ns.core', parent=root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >'])
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, std::size_t const )', u'ns3::Hash::Hash32Function_ptr')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, std::size_t const )*', u'ns3::Hash::Hash32Function_ptr*')
typehandlers.add_type_alias(u'uint32_t ( * ) ( char const *, std::size_t const )&', u'ns3::Hash::Hash32Function_ptr&')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, std::size_t const )', u'ns3::Hash::Hash64Function_ptr')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, std::size_t const )*', u'ns3::Hash::Hash64Function_ptr*')
typehandlers.add_type_alias(u'uint64_t ( * ) ( char const *, std::size_t const )&', u'ns3::Hash::Hash64Function_ptr&')
## Register a nested module for the namespace Function
nested_module = module.add_cpp_namespace('Function')
register_types_ns3_Hash_Function(nested_module)
def register_types_ns3_Hash_Function(module):
root_module = module.get_root()
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a [class]
module.add_class('Fnv1a', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32 [class]
module.add_class('Hash32', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64 [class]
module.add_class('Hash64', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3 [class]
module.add_class('Murmur3', import_from_module='ns.core', parent=root_module['ns3::Hash::Implementation'])
def register_types_ns3_TracedValueCallback(module):
root_module = module.get_root()
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time, ns3::Time )', u'ns3::TracedValueCallback::Time')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time, ns3::Time )*', u'ns3::TracedValueCallback::Time*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::Time, ns3::Time )&', u'ns3::TracedValueCallback::Time&')
def register_types_ns3_olsr(module):
root_module = module.get_root()
## olsr-repositories.h (module 'olsr'): ns3::olsr::Association [struct]
module.add_class('Association')
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple [struct]
module.add_class('AssociationTuple')
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple [struct]
module.add_class('DuplicateTuple')
## olsr-repositories.h (module 'olsr'): ns3::olsr::IfaceAssocTuple [struct]
module.add_class('IfaceAssocTuple')
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple [struct]
module.add_class('LinkTuple')
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader [class]
module.add_class('MessageHeader', parent=root_module['ns3::Header'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::MessageType [enumeration]
module.add_enum('MessageType', ['HELLO_MESSAGE', 'TC_MESSAGE', 'MID_MESSAGE', 'HNA_MESSAGE'], outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello [struct]
module.add_class('Hello', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::LinkMessage [struct]
module.add_class('LinkMessage', outer_class=root_module['ns3::olsr::MessageHeader::Hello'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna [struct]
module.add_class('Hna', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Association [struct]
module.add_class('Association', outer_class=root_module['ns3::olsr::MessageHeader::Hna'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Mid [struct]
module.add_class('Mid', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc [struct]
module.add_class('Tc', outer_class=root_module['ns3::olsr::MessageHeader'])
## olsr-repositories.h (module 'olsr'): ns3::olsr::MprSelectorTuple [struct]
module.add_class('MprSelectorTuple')
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple [struct]
module.add_class('NeighborTuple')
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple::Status [enumeration]
module.add_enum('Status', ['STATUS_NOT_SYM', 'STATUS_SYM'], outer_class=root_module['ns3::olsr::NeighborTuple'])
## olsr-state.h (module 'olsr'): ns3::olsr::OlsrState [class]
module.add_class('OlsrState')
## olsr-header.h (module 'olsr'): ns3::olsr::PacketHeader [class]
module.add_class('PacketHeader', parent=root_module['ns3::Header'])
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingProtocol [class]
module.add_class('RoutingProtocol', parent=root_module['ns3::Ipv4RoutingProtocol'])
typehandlers.add_type_alias(u'void ( * ) ( ns3::olsr::PacketHeader const &, ns3::olsr::MessageList const & )', u'ns3::olsr::RoutingProtocol::PacketTxRxTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( ns3::olsr::PacketHeader const &, ns3::olsr::MessageList const & )*', u'ns3::olsr::RoutingProtocol::PacketTxRxTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( ns3::olsr::PacketHeader const &, ns3::olsr::MessageList const & )&', u'ns3::olsr::RoutingProtocol::PacketTxRxTracedCallback&')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t )', u'ns3::olsr::RoutingProtocol::TableChangeTracedCallback')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t )*', u'ns3::olsr::RoutingProtocol::TableChangeTracedCallback*')
typehandlers.add_type_alias(u'void ( * ) ( uint32_t )&', u'ns3::olsr::RoutingProtocol::TableChangeTracedCallback&')
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry [struct]
module.add_class('RoutingTableEntry')
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple [struct]
module.add_class('TopologyTuple')
## olsr-repositories.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple [struct]
module.add_class('TwoHopNeighborTuple')
module.add_container('std::vector< ns3::Ipv4Address >', 'ns3::Ipv4Address', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', 'ns3::olsr::MessageHeader::Hello::LinkMessage', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::MessageHeader::Hna::Association >', 'ns3::olsr::MessageHeader::Hna::Association', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::MprSelectorTuple >', 'ns3::olsr::MprSelectorTuple', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::NeighborTuple >', 'ns3::olsr::NeighborTuple', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::TwoHopNeighborTuple >', 'ns3::olsr::TwoHopNeighborTuple', container_type=u'vector')
module.add_container('ns3::olsr::MprSet', 'ns3::Ipv4Address', container_type=u'set')
module.add_container('std::vector< ns3::olsr::LinkTuple >', 'ns3::olsr::LinkTuple', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::TopologyTuple >', 'ns3::olsr::TopologyTuple', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::IfaceAssocTuple >', 'ns3::olsr::IfaceAssocTuple', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::AssociationTuple >', 'ns3::olsr::AssociationTuple', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::Association >', 'ns3::olsr::Association', container_type=u'vector')
module.add_container('std::vector< ns3::olsr::RoutingTableEntry >', 'ns3::olsr::RoutingTableEntry', container_type=u'vector')
module.add_container('std::set< unsigned int >', 'unsigned int', container_type=u'set')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::MessageHeader >', u'ns3::olsr::MessageList')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::MessageHeader >*', u'ns3::olsr::MessageList*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::MessageHeader >&', u'ns3::olsr::MessageList&')
typehandlers.add_type_alias(u'std::set< ns3::Ipv4Address >', u'ns3::olsr::MprSet')
typehandlers.add_type_alias(u'std::set< ns3::Ipv4Address >*', u'ns3::olsr::MprSet*')
typehandlers.add_type_alias(u'std::set< ns3::Ipv4Address >&', u'ns3::olsr::MprSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::MprSelectorTuple >', u'ns3::olsr::MprSelectorSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::MprSelectorTuple >*', u'ns3::olsr::MprSelectorSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::MprSelectorTuple >&', u'ns3::olsr::MprSelectorSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::LinkTuple >', u'ns3::olsr::LinkSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::LinkTuple >*', u'ns3::olsr::LinkSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::LinkTuple >&', u'ns3::olsr::LinkSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::NeighborTuple >', u'ns3::olsr::NeighborSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::NeighborTuple >*', u'ns3::olsr::NeighborSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::NeighborTuple >&', u'ns3::olsr::NeighborSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::TwoHopNeighborTuple >', u'ns3::olsr::TwoHopNeighborSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::TwoHopNeighborTuple >*', u'ns3::olsr::TwoHopNeighborSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::TwoHopNeighborTuple >&', u'ns3::olsr::TwoHopNeighborSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::TopologyTuple >', u'ns3::olsr::TopologySet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::TopologyTuple >*', u'ns3::olsr::TopologySet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::TopologyTuple >&', u'ns3::olsr::TopologySet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::DuplicateTuple >', u'ns3::olsr::DuplicateSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::DuplicateTuple >*', u'ns3::olsr::DuplicateSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::DuplicateTuple >&', u'ns3::olsr::DuplicateSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::IfaceAssocTuple >', u'ns3::olsr::IfaceAssocSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::IfaceAssocTuple >*', u'ns3::olsr::IfaceAssocSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::IfaceAssocTuple >&', u'ns3::olsr::IfaceAssocSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::AssociationTuple >', u'ns3::olsr::AssociationSet')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::AssociationTuple >*', u'ns3::olsr::AssociationSet*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::AssociationTuple >&', u'ns3::olsr::AssociationSet&')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::Association >', u'ns3::olsr::Associations')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::Association >*', u'ns3::olsr::Associations*')
typehandlers.add_type_alias(u'std::vector< ns3::olsr::Association >&', u'ns3::olsr::Associations&')
def register_types_ns3_tests(module):
root_module = module.get_root()
def register_methods(root_module):
register_Ns3Address_methods(root_module, root_module['ns3::Address'])
register_Ns3AttributeConstructionList_methods(root_module, root_module['ns3::AttributeConstructionList'])
register_Ns3AttributeConstructionListItem_methods(root_module, root_module['ns3::AttributeConstructionList::Item'])
register_Ns3Buffer_methods(root_module, root_module['ns3::Buffer'])
register_Ns3BufferIterator_methods(root_module, root_module['ns3::Buffer::Iterator'])
register_Ns3ByteTagIterator_methods(root_module, root_module['ns3::ByteTagIterator'])
register_Ns3ByteTagIteratorItem_methods(root_module, root_module['ns3::ByteTagIterator::Item'])
register_Ns3ByteTagList_methods(root_module, root_module['ns3::ByteTagList'])
register_Ns3ByteTagListIterator_methods(root_module, root_module['ns3::ByteTagList::Iterator'])
register_Ns3ByteTagListIteratorItem_methods(root_module, root_module['ns3::ByteTagList::Iterator::Item'])
register_Ns3CallbackBase_methods(root_module, root_module['ns3::CallbackBase'])
register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeAccessor >'])
register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeChecker >'])
register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, root_module['ns3::DefaultDeleter< ns3::AttributeValue >'])
register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, root_module['ns3::DefaultDeleter< ns3::CallbackImplBase >'])
register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, root_module['ns3::DefaultDeleter< ns3::EventImpl >'])
register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Hash::Implementation >'])
register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, root_module['ns3::DefaultDeleter< ns3::NixVector >'])
register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, root_module['ns3::DefaultDeleter< ns3::Packet >'])
register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::DefaultDeleter< ns3::TraceSourceAccessor >'])
register_Ns3EventGarbageCollector_methods(root_module, root_module['ns3::EventGarbageCollector'])
register_Ns3EventId_methods(root_module, root_module['ns3::EventId'])
register_Ns3Hasher_methods(root_module, root_module['ns3::Hasher'])
register_Ns3Inet6SocketAddress_methods(root_module, root_module['ns3::Inet6SocketAddress'])
register_Ns3InetSocketAddress_methods(root_module, root_module['ns3::InetSocketAddress'])
register_Ns3IntToType__0_methods(root_module, root_module['ns3::IntToType< 0 >'])
register_Ns3IntToType__1_methods(root_module, root_module['ns3::IntToType< 1 >'])
register_Ns3IntToType__2_methods(root_module, root_module['ns3::IntToType< 2 >'])
register_Ns3IntToType__3_methods(root_module, root_module['ns3::IntToType< 3 >'])
register_Ns3IntToType__4_methods(root_module, root_module['ns3::IntToType< 4 >'])
register_Ns3IntToType__5_methods(root_module, root_module['ns3::IntToType< 5 >'])
register_Ns3IntToType__6_methods(root_module, root_module['ns3::IntToType< 6 >'])
register_Ns3Ipv4Address_methods(root_module, root_module['ns3::Ipv4Address'])
register_Ns3Ipv4InterfaceAddress_methods(root_module, root_module['ns3::Ipv4InterfaceAddress'])
register_Ns3Ipv4Mask_methods(root_module, root_module['ns3::Ipv4Mask'])
register_Ns3Ipv4RoutingHelper_methods(root_module, root_module['ns3::Ipv4RoutingHelper'])
register_Ns3Ipv6Address_methods(root_module, root_module['ns3::Ipv6Address'])
register_Ns3Ipv6Prefix_methods(root_module, root_module['ns3::Ipv6Prefix'])
register_Ns3Mac48Address_methods(root_module, root_module['ns3::Mac48Address'])
register_Ns3Mac8Address_methods(root_module, root_module['ns3::Mac8Address'])
register_Ns3NodeContainer_methods(root_module, root_module['ns3::NodeContainer'])
register_Ns3NonCopyable_methods(root_module, root_module['ns3::NonCopyable'])
register_Ns3ObjectBase_methods(root_module, root_module['ns3::ObjectBase'])
register_Ns3ObjectDeleter_methods(root_module, root_module['ns3::ObjectDeleter'])
register_Ns3ObjectFactory_methods(root_module, root_module['ns3::ObjectFactory'])
register_Ns3OlsrHelper_methods(root_module, root_module['ns3::OlsrHelper'])
register_Ns3PacketMetadata_methods(root_module, root_module['ns3::PacketMetadata'])
register_Ns3PacketMetadataItem_methods(root_module, root_module['ns3::PacketMetadata::Item'])
register_Ns3PacketMetadataItemIterator_methods(root_module, root_module['ns3::PacketMetadata::ItemIterator'])
register_Ns3PacketTagIterator_methods(root_module, root_module['ns3::PacketTagIterator'])
register_Ns3PacketTagIteratorItem_methods(root_module, root_module['ns3::PacketTagIterator::Item'])
register_Ns3PacketTagList_methods(root_module, root_module['ns3::PacketTagList'])
register_Ns3PacketTagListTagData_methods(root_module, root_module['ns3::PacketTagList::TagData'])
register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, root_module['ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter >'])
register_Ns3Simulator_methods(root_module, root_module['ns3::Simulator'])
register_Ns3SystemWallClockMs_methods(root_module, root_module['ns3::SystemWallClockMs'])
register_Ns3Tag_methods(root_module, root_module['ns3::Tag'])
register_Ns3TagBuffer_methods(root_module, root_module['ns3::TagBuffer'])
register_Ns3TimeWithUnit_methods(root_module, root_module['ns3::TimeWithUnit'])
register_Ns3Timer_methods(root_module, root_module['ns3::Timer'])
register_Ns3TimerImpl_methods(root_module, root_module['ns3::TimerImpl'])
register_Ns3TypeId_methods(root_module, root_module['ns3::TypeId'])
register_Ns3TypeIdAttributeInformation_methods(root_module, root_module['ns3::TypeId::AttributeInformation'])
register_Ns3TypeIdTraceSourceInformation_methods(root_module, root_module['ns3::TypeId::TraceSourceInformation'])
register_Ns3Empty_methods(root_module, root_module['ns3::empty'])
register_Ns3Int64x64_t_methods(root_module, root_module['ns3::int64x64_t'])
register_Ns3Chunk_methods(root_module, root_module['ns3::Chunk'])
register_Ns3Header_methods(root_module, root_module['ns3::Header'])
register_Ns3Ipv4Header_methods(root_module, root_module['ns3::Ipv4Header'])
register_Ns3Object_methods(root_module, root_module['ns3::Object'])
register_Ns3ObjectAggregateIterator_methods(root_module, root_module['ns3::Object::AggregateIterator'])
register_Ns3RandomVariableStream_methods(root_module, root_module['ns3::RandomVariableStream'])
register_Ns3SequentialRandomVariable_methods(root_module, root_module['ns3::SequentialRandomVariable'])
register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >'])
register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >'])
register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >'])
register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >'])<|fim▁hole|> register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >'])
register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >'])
register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >'])
register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >'])
register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >'])
register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >'])
register_Ns3Socket_methods(root_module, root_module['ns3::Socket'])
register_Ns3SocketIpTosTag_methods(root_module, root_module['ns3::SocketIpTosTag'])
register_Ns3SocketIpTtlTag_methods(root_module, root_module['ns3::SocketIpTtlTag'])
register_Ns3SocketIpv6HopLimitTag_methods(root_module, root_module['ns3::SocketIpv6HopLimitTag'])
register_Ns3SocketIpv6TclassTag_methods(root_module, root_module['ns3::SocketIpv6TclassTag'])
register_Ns3SocketPriorityTag_methods(root_module, root_module['ns3::SocketPriorityTag'])
register_Ns3SocketSetDontFragmentTag_methods(root_module, root_module['ns3::SocketSetDontFragmentTag'])
register_Ns3Time_methods(root_module, root_module['ns3::Time'])
register_Ns3TraceSourceAccessor_methods(root_module, root_module['ns3::TraceSourceAccessor'])
register_Ns3Trailer_methods(root_module, root_module['ns3::Trailer'])
register_Ns3TriangularRandomVariable_methods(root_module, root_module['ns3::TriangularRandomVariable'])
register_Ns3UniformRandomVariable_methods(root_module, root_module['ns3::UniformRandomVariable'])
register_Ns3WeibullRandomVariable_methods(root_module, root_module['ns3::WeibullRandomVariable'])
register_Ns3ZetaRandomVariable_methods(root_module, root_module['ns3::ZetaRandomVariable'])
register_Ns3ZipfRandomVariable_methods(root_module, root_module['ns3::ZipfRandomVariable'])
register_Ns3AttributeAccessor_methods(root_module, root_module['ns3::AttributeAccessor'])
register_Ns3AttributeChecker_methods(root_module, root_module['ns3::AttributeChecker'])
register_Ns3AttributeValue_methods(root_module, root_module['ns3::AttributeValue'])
register_Ns3CallbackChecker_methods(root_module, root_module['ns3::CallbackChecker'])
register_Ns3CallbackImplBase_methods(root_module, root_module['ns3::CallbackImplBase'])
register_Ns3CallbackValue_methods(root_module, root_module['ns3::CallbackValue'])
register_Ns3ConstantRandomVariable_methods(root_module, root_module['ns3::ConstantRandomVariable'])
register_Ns3DeterministicRandomVariable_methods(root_module, root_module['ns3::DeterministicRandomVariable'])
register_Ns3EmpiricalRandomVariable_methods(root_module, root_module['ns3::EmpiricalRandomVariable'])
register_Ns3EmptyAttributeAccessor_methods(root_module, root_module['ns3::EmptyAttributeAccessor'])
register_Ns3EmptyAttributeChecker_methods(root_module, root_module['ns3::EmptyAttributeChecker'])
register_Ns3EmptyAttributeValue_methods(root_module, root_module['ns3::EmptyAttributeValue'])
register_Ns3ErlangRandomVariable_methods(root_module, root_module['ns3::ErlangRandomVariable'])
register_Ns3EventImpl_methods(root_module, root_module['ns3::EventImpl'])
register_Ns3ExponentialRandomVariable_methods(root_module, root_module['ns3::ExponentialRandomVariable'])
register_Ns3GammaRandomVariable_methods(root_module, root_module['ns3::GammaRandomVariable'])
register_Ns3Ipv4_methods(root_module, root_module['ns3::Ipv4'])
register_Ns3Ipv4AddressChecker_methods(root_module, root_module['ns3::Ipv4AddressChecker'])
register_Ns3Ipv4AddressValue_methods(root_module, root_module['ns3::Ipv4AddressValue'])
register_Ns3Ipv4MaskChecker_methods(root_module, root_module['ns3::Ipv4MaskChecker'])
register_Ns3Ipv4MaskValue_methods(root_module, root_module['ns3::Ipv4MaskValue'])
register_Ns3Ipv4MulticastRoute_methods(root_module, root_module['ns3::Ipv4MulticastRoute'])
register_Ns3Ipv4Route_methods(root_module, root_module['ns3::Ipv4Route'])
register_Ns3Ipv4RoutingProtocol_methods(root_module, root_module['ns3::Ipv4RoutingProtocol'])
register_Ns3Ipv4StaticRouting_methods(root_module, root_module['ns3::Ipv4StaticRouting'])
register_Ns3Ipv6AddressChecker_methods(root_module, root_module['ns3::Ipv6AddressChecker'])
register_Ns3Ipv6AddressValue_methods(root_module, root_module['ns3::Ipv6AddressValue'])
register_Ns3Ipv6PrefixChecker_methods(root_module, root_module['ns3::Ipv6PrefixChecker'])
register_Ns3Ipv6PrefixValue_methods(root_module, root_module['ns3::Ipv6PrefixValue'])
register_Ns3LogNormalRandomVariable_methods(root_module, root_module['ns3::LogNormalRandomVariable'])
register_Ns3Mac48AddressChecker_methods(root_module, root_module['ns3::Mac48AddressChecker'])
register_Ns3Mac48AddressValue_methods(root_module, root_module['ns3::Mac48AddressValue'])
register_Ns3NetDevice_methods(root_module, root_module['ns3::NetDevice'])
register_Ns3NixVector_methods(root_module, root_module['ns3::NixVector'])
register_Ns3Node_methods(root_module, root_module['ns3::Node'])
register_Ns3NormalRandomVariable_methods(root_module, root_module['ns3::NormalRandomVariable'])
register_Ns3ObjectFactoryChecker_methods(root_module, root_module['ns3::ObjectFactoryChecker'])
register_Ns3ObjectFactoryValue_methods(root_module, root_module['ns3::ObjectFactoryValue'])
register_Ns3OutputStreamWrapper_methods(root_module, root_module['ns3::OutputStreamWrapper'])
register_Ns3Packet_methods(root_module, root_module['ns3::Packet'])
register_Ns3ParetoRandomVariable_methods(root_module, root_module['ns3::ParetoRandomVariable'])
register_Ns3TimeValue_methods(root_module, root_module['ns3::TimeValue'])
register_Ns3TypeIdChecker_methods(root_module, root_module['ns3::TypeIdChecker'])
register_Ns3TypeIdValue_methods(root_module, root_module['ns3::TypeIdValue'])
register_Ns3AddressChecker_methods(root_module, root_module['ns3::AddressChecker'])
register_Ns3AddressValue_methods(root_module, root_module['ns3::AddressValue'])
register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Const_ns3OlsrPacketHeader___amp___Const_stdVector__lt__ns3OlsrMessageHeader__stdAllocator__lt__ns3OlsrMessageHeader__gt_____gt_____amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3CallbackImpl__Void_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, root_module['ns3::CallbackImpl< void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >'])
register_Ns3Ipv4ListRouting_methods(root_module, root_module['ns3::Ipv4ListRouting'])
register_Ns3HashImplementation_methods(root_module, root_module['ns3::Hash::Implementation'])
register_Ns3HashFunctionFnv1a_methods(root_module, root_module['ns3::Hash::Function::Fnv1a'])
register_Ns3HashFunctionHash32_methods(root_module, root_module['ns3::Hash::Function::Hash32'])
register_Ns3HashFunctionHash64_methods(root_module, root_module['ns3::Hash::Function::Hash64'])
register_Ns3HashFunctionMurmur3_methods(root_module, root_module['ns3::Hash::Function::Murmur3'])
register_Ns3OlsrAssociation_methods(root_module, root_module['ns3::olsr::Association'])
register_Ns3OlsrAssociationTuple_methods(root_module, root_module['ns3::olsr::AssociationTuple'])
register_Ns3OlsrDuplicateTuple_methods(root_module, root_module['ns3::olsr::DuplicateTuple'])
register_Ns3OlsrIfaceAssocTuple_methods(root_module, root_module['ns3::olsr::IfaceAssocTuple'])
register_Ns3OlsrLinkTuple_methods(root_module, root_module['ns3::olsr::LinkTuple'])
register_Ns3OlsrMessageHeader_methods(root_module, root_module['ns3::olsr::MessageHeader'])
register_Ns3OlsrMessageHeaderHello_methods(root_module, root_module['ns3::olsr::MessageHeader::Hello'])
register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, root_module['ns3::olsr::MessageHeader::Hello::LinkMessage'])
register_Ns3OlsrMessageHeaderHna_methods(root_module, root_module['ns3::olsr::MessageHeader::Hna'])
register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, root_module['ns3::olsr::MessageHeader::Hna::Association'])
register_Ns3OlsrMessageHeaderMid_methods(root_module, root_module['ns3::olsr::MessageHeader::Mid'])
register_Ns3OlsrMessageHeaderTc_methods(root_module, root_module['ns3::olsr::MessageHeader::Tc'])
register_Ns3OlsrMprSelectorTuple_methods(root_module, root_module['ns3::olsr::MprSelectorTuple'])
register_Ns3OlsrNeighborTuple_methods(root_module, root_module['ns3::olsr::NeighborTuple'])
register_Ns3OlsrOlsrState_methods(root_module, root_module['ns3::olsr::OlsrState'])
register_Ns3OlsrPacketHeader_methods(root_module, root_module['ns3::olsr::PacketHeader'])
register_Ns3OlsrRoutingProtocol_methods(root_module, root_module['ns3::olsr::RoutingProtocol'])
register_Ns3OlsrRoutingTableEntry_methods(root_module, root_module['ns3::olsr::RoutingTableEntry'])
register_Ns3OlsrTopologyTuple_methods(root_module, root_module['ns3::olsr::TopologyTuple'])
register_Ns3OlsrTwoHopNeighborTuple_methods(root_module, root_module['ns3::olsr::TwoHopNeighborTuple'])
return
def register_Ns3Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## address.h (module 'network'): ns3::Address::Address() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::Address::Address(uint8_t type, uint8_t const * buffer, uint8_t len) [constructor]
cls.add_constructor([param('uint8_t', 'type'), param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): ns3::Address::Address(ns3::Address const & address) [constructor]
cls.add_constructor([param('ns3::Address const &', 'address')])
## address.h (module 'network'): bool ns3::Address::CheckCompatible(uint8_t type, uint8_t len) const [member function]
cls.add_method('CheckCompatible',
'bool',
[param('uint8_t', 'type'), param('uint8_t', 'len')],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::CopyAllFrom(uint8_t const * buffer, uint8_t len) [member function]
cls.add_method('CopyAllFrom',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): uint32_t ns3::Address::CopyAllTo(uint8_t * buffer, uint8_t len) const [member function]
cls.add_method('CopyAllTo',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint8_t', 'len')],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::CopyFrom(uint8_t const * buffer, uint8_t len) [member function]
cls.add_method('CopyFrom',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint8_t', 'len')])
## address.h (module 'network'): uint32_t ns3::Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'uint32_t',
[param('uint8_t *', 'buffer')],
is_const=True)
## address.h (module 'network'): void ns3::Address::Deserialize(ns3::TagBuffer buffer) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'buffer')])
## address.h (module 'network'): uint8_t ns3::Address::GetLength() const [member function]
cls.add_method('GetLength',
'uint8_t',
[],
is_const=True)
## address.h (module 'network'): uint32_t ns3::Address::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## address.h (module 'network'): bool ns3::Address::IsInvalid() const [member function]
cls.add_method('IsInvalid',
'bool',
[],
is_const=True)
## address.h (module 'network'): bool ns3::Address::IsMatchingType(uint8_t type) const [member function]
cls.add_method('IsMatchingType',
'bool',
[param('uint8_t', 'type')],
is_const=True)
## address.h (module 'network'): static uint8_t ns3::Address::Register() [member function]
cls.add_method('Register',
'uint8_t',
[],
is_static=True)
## address.h (module 'network'): void ns3::Address::Serialize(ns3::TagBuffer buffer) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'buffer')],
is_const=True)
return
def register_Ns3AttributeConstructionList_methods(root_module, cls):
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList(ns3::AttributeConstructionList const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeConstructionList const &', 'arg0')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::AttributeConstructionList() [constructor]
cls.add_constructor([])
## attribute-construction-list.h (module 'core'): void ns3::AttributeConstructionList::Add(std::string name, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::Ptr<ns3::AttributeValue> value) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'name'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::Ptr< ns3::AttributeValue >', 'value')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::CIterator ns3::AttributeConstructionList::Begin() const [member function]
cls.add_method('Begin',
'ns3::AttributeConstructionList::CIterator',
[],
is_const=True)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::CIterator ns3::AttributeConstructionList::End() const [member function]
cls.add_method('End',
'ns3::AttributeConstructionList::CIterator',
[],
is_const=True)
## attribute-construction-list.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeConstructionList::Find(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('Find',
'ns3::Ptr< ns3::AttributeValue >',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True)
return
def register_Ns3AttributeConstructionListItem_methods(root_module, cls):
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item() [constructor]
cls.add_constructor([])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::Item(ns3::AttributeConstructionList::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeConstructionList::Item const &', 'arg0')])
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::checker [variable]
cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## attribute-construction-list.h (module 'core'): ns3::AttributeConstructionList::Item::value [variable]
cls.add_instance_attribute('value', 'ns3::Ptr< ns3::AttributeValue >', is_const=False)
return
def register_Ns3Buffer_methods(root_module, cls):
## buffer.h (module 'network'): ns3::Buffer::Buffer(ns3::Buffer const & o) [constructor]
cls.add_constructor([param('ns3::Buffer const &', 'o')])
## buffer.h (module 'network'): ns3::Buffer::Buffer() [constructor]
cls.add_constructor([])
## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize) [constructor]
cls.add_constructor([param('uint32_t', 'dataSize')])
## buffer.h (module 'network'): ns3::Buffer::Buffer(uint32_t dataSize, bool initialize) [constructor]
cls.add_constructor([param('uint32_t', 'dataSize'), param('bool', 'initialize')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(uint32_t end) [member function]
cls.add_method('AddAtEnd',
'void',
[param('uint32_t', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtEnd(ns3::Buffer const & o) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Buffer const &', 'o')])
## buffer.h (module 'network'): void ns3::Buffer::AddAtStart(uint32_t start) [member function]
cls.add_method('AddAtStart',
'void',
[param('uint32_t', 'start')])
## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::Begin() const [member function]
cls.add_method('Begin',
'ns3::Buffer::Iterator',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::CopyData(std::ostream * os, uint32_t size) const [member function]
cls.add_method('CopyData',
'void',
[param('std::ostream *', 'os'), param('uint32_t', 'size')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::CopyData(uint8_t * buffer, uint32_t size) const [member function]
cls.add_method('CopyData',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')],
is_const=True)
## buffer.h (module 'network'): ns3::Buffer ns3::Buffer::CreateFragment(uint32_t start, uint32_t length) const [member function]
cls.add_method('CreateFragment',
'ns3::Buffer',
[param('uint32_t', 'start'), param('uint32_t', 'length')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Deserialize(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): ns3::Buffer::Iterator ns3::Buffer::End() const [member function]
cls.add_method('End',
'ns3::Buffer::Iterator',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint8_t const * ns3::Buffer::PeekData() const [member function]
cls.add_method('PeekData',
'uint8_t const *',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::RemoveAtEnd(uint32_t end) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::RemoveAtStart(uint32_t start) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'start')])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3BufferIterator_methods(root_module, cls):
## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator(ns3::Buffer::Iterator const & arg0) [constructor]
cls.add_constructor([param('ns3::Buffer::Iterator const &', 'arg0')])
## buffer.h (module 'network'): ns3::Buffer::Iterator::Iterator() [constructor]
cls.add_constructor([])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size) [member function]
cls.add_method('CalculateIpChecksum',
'uint16_t',
[param('uint16_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::CalculateIpChecksum(uint16_t size, uint32_t initialChecksum) [member function]
cls.add_method('CalculateIpChecksum',
'uint16_t',
[param('uint16_t', 'size'), param('uint32_t', 'initialChecksum')])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetDistanceFrom(ns3::Buffer::Iterator const & o) const [member function]
cls.add_method('GetDistanceFrom',
'uint32_t',
[param('ns3::Buffer::Iterator const &', 'o')],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetRemainingSize() const [member function]
cls.add_method('GetRemainingSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsEnd() const [member function]
cls.add_method('IsEnd',
'bool',
[],
is_const=True)
## buffer.h (module 'network'): bool ns3::Buffer::Iterator::IsStart() const [member function]
cls.add_method('IsStart',
'bool',
[],
is_const=True)
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next() [member function]
cls.add_method('Next',
'void',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Next(uint32_t delta) [member function]
cls.add_method('Next',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::PeekU8() [member function]
cls.add_method('PeekU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev() [member function]
cls.add_method('Prev',
'void',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Prev(uint32_t delta) [member function]
cls.add_method('Prev',
'void',
[param('uint32_t', 'delta')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(uint8_t * buffer, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Read(ns3::Buffer::Iterator start, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'size')])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadLsbtohU16() [member function]
cls.add_method('ReadLsbtohU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadLsbtohU32() [member function]
cls.add_method('ReadLsbtohU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadLsbtohU64() [member function]
cls.add_method('ReadLsbtohU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadNtohU16() [member function]
cls.add_method('ReadNtohU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadNtohU32() [member function]
cls.add_method('ReadNtohU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadNtohU64() [member function]
cls.add_method('ReadNtohU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint16_t ns3::Buffer::Iterator::ReadU16() [member function]
cls.add_method('ReadU16',
'uint16_t',
[])
## buffer.h (module 'network'): uint32_t ns3::Buffer::Iterator::ReadU32() [member function]
cls.add_method('ReadU32',
'uint32_t',
[])
## buffer.h (module 'network'): uint64_t ns3::Buffer::Iterator::ReadU64() [member function]
cls.add_method('ReadU64',
'uint64_t',
[])
## buffer.h (module 'network'): uint8_t ns3::Buffer::Iterator::ReadU8() [member function]
cls.add_method('ReadU8',
'uint8_t',
[])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Write',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::Write(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Write',
'void',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU16(uint16_t data) [member function]
cls.add_method('WriteHtolsbU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU32(uint32_t data) [member function]
cls.add_method('WriteHtolsbU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtolsbU64(uint64_t data) [member function]
cls.add_method('WriteHtolsbU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU16(uint16_t data) [member function]
cls.add_method('WriteHtonU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU32(uint32_t data) [member function]
cls.add_method('WriteHtonU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteHtonU64(uint64_t data) [member function]
cls.add_method('WriteHtonU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU16(uint16_t data) [member function]
cls.add_method('WriteU16',
'void',
[param('uint16_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU32(uint32_t data) [member function]
cls.add_method('WriteU32',
'void',
[param('uint32_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU64(uint64_t data) [member function]
cls.add_method('WriteU64',
'void',
[param('uint64_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'data')])
## buffer.h (module 'network'): void ns3::Buffer::Iterator::WriteU8(uint8_t data, uint32_t len) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'data'), param('uint32_t', 'len')])
return
def register_Ns3ByteTagIterator_methods(root_module, cls):
## packet.h (module 'network'): ns3::ByteTagIterator::ByteTagIterator(ns3::ByteTagIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagIterator const &', 'arg0')])
## packet.h (module 'network'): bool ns3::ByteTagIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet.h (module 'network'): ns3::ByteTagIterator::Item ns3::ByteTagIterator::Next() [member function]
cls.add_method('Next',
'ns3::ByteTagIterator::Item',
[])
return
def register_Ns3ByteTagIteratorItem_methods(root_module, cls):
## packet.h (module 'network'): ns3::ByteTagIterator::Item::Item(ns3::ByteTagIterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagIterator::Item const &', 'arg0')])
## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetEnd() const [member function]
cls.add_method('GetEnd',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::ByteTagIterator::Item::GetStart() const [member function]
cls.add_method('GetStart',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): void ns3::ByteTagIterator::Item::GetTag(ns3::Tag & tag) const [member function]
cls.add_method('GetTag',
'void',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::TypeId ns3::ByteTagIterator::Item::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
return
def register_Ns3ByteTagList_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList() [constructor]
cls.add_constructor([])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::ByteTagList(ns3::ByteTagList const & o) [constructor]
cls.add_constructor([param('ns3::ByteTagList const &', 'o')])
## byte-tag-list.h (module 'network'): ns3::TagBuffer ns3::ByteTagList::Add(ns3::TypeId tid, uint32_t bufferSize, int32_t start, int32_t end) [member function]
cls.add_method('Add',
'ns3::TagBuffer',
[param('ns3::TypeId', 'tid'), param('uint32_t', 'bufferSize'), param('int32_t', 'start'), param('int32_t', 'end')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Add(ns3::ByteTagList const & o) [member function]
cls.add_method('Add',
'void',
[param('ns3::ByteTagList const &', 'o')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtEnd(int32_t appendOffset) [member function]
cls.add_method('AddAtEnd',
'void',
[param('int32_t', 'appendOffset')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::AddAtStart(int32_t prependOffset) [member function]
cls.add_method('AddAtStart',
'void',
[param('int32_t', 'prependOffset')])
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::Adjust(int32_t adjustment) [member function]
cls.add_method('Adjust',
'void',
[param('int32_t', 'adjustment')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator ns3::ByteTagList::Begin(int32_t offsetStart, int32_t offsetEnd) const [member function]
cls.add_method('Begin',
'ns3::ByteTagList::Iterator',
[param('int32_t', 'offsetStart'), param('int32_t', 'offsetEnd')],
is_const=True)
## byte-tag-list.h (module 'network'): void ns3::ByteTagList::RemoveAll() [member function]
cls.add_method('RemoveAll',
'void',
[])
return
def register_Ns3ByteTagListIterator_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Iterator(ns3::ByteTagList::Iterator const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagList::Iterator const &', 'arg0')])
## byte-tag-list.h (module 'network'): uint32_t ns3::ByteTagList::Iterator::GetOffsetStart() const [member function]
cls.add_method('GetOffsetStart',
'uint32_t',
[],
is_const=True)
## byte-tag-list.h (module 'network'): bool ns3::ByteTagList::Iterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item ns3::ByteTagList::Iterator::Next() [member function]
cls.add_method('Next',
'ns3::ByteTagList::Iterator::Item',
[])
return
def register_Ns3ByteTagListIteratorItem_methods(root_module, cls):
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::ByteTagList::Iterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::ByteTagList::Iterator::Item const &', 'arg0')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::Item(ns3::TagBuffer buf) [constructor]
cls.add_constructor([param('ns3::TagBuffer', 'buf')])
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::buf [variable]
cls.add_instance_attribute('buf', 'ns3::TagBuffer', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::end [variable]
cls.add_instance_attribute('end', 'int32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::size [variable]
cls.add_instance_attribute('size', 'uint32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::start [variable]
cls.add_instance_attribute('start', 'int32_t', is_const=False)
## byte-tag-list.h (module 'network'): ns3::ByteTagList::Iterator::Item::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
return
def register_Ns3CallbackBase_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::CallbackBase const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackBase const &', 'arg0')])
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::Ptr<ns3::CallbackImplBase> ns3::CallbackBase::GetImpl() const [member function]
cls.add_method('GetImpl',
'ns3::Ptr< ns3::CallbackImplBase >',
[],
is_const=True)
## callback.h (module 'core'): ns3::CallbackBase::CallbackBase(ns3::Ptr<ns3::CallbackImplBase> impl) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::CallbackImplBase >', 'impl')],
visibility='protected')
return
def register_Ns3DefaultDeleter__Ns3AttributeAccessor_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeAccessor>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeAccessor> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeAccessor > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeAccessor>::Delete(ns3::AttributeAccessor * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeAccessor *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeChecker_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeChecker>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeChecker> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeChecker > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeChecker>::Delete(ns3::AttributeChecker * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeChecker *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3AttributeValue_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::AttributeValue>::DefaultDeleter(ns3::DefaultDeleter<ns3::AttributeValue> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::AttributeValue > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::AttributeValue>::Delete(ns3::AttributeValue * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::AttributeValue *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3CallbackImplBase_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::CallbackImplBase>::DefaultDeleter(ns3::DefaultDeleter<ns3::CallbackImplBase> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::CallbackImplBase > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::CallbackImplBase>::Delete(ns3::CallbackImplBase * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::CallbackImplBase *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3EventImpl_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::EventImpl>::DefaultDeleter(ns3::DefaultDeleter<ns3::EventImpl> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::EventImpl > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::EventImpl>::Delete(ns3::EventImpl * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::EventImpl *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3HashImplementation_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Hash::Implementation>::DefaultDeleter(ns3::DefaultDeleter<ns3::Hash::Implementation> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Hash::Implementation > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Hash::Implementation>::Delete(ns3::Hash::Implementation * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Hash::Implementation *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3NixVector_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::NixVector>::DefaultDeleter(ns3::DefaultDeleter<ns3::NixVector> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::NixVector > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::NixVector>::Delete(ns3::NixVector * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::NixVector *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3Packet_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::Packet>::DefaultDeleter(ns3::DefaultDeleter<ns3::Packet> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::Packet > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::Packet>::Delete(ns3::Packet * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Packet *', 'object')],
is_static=True)
return
def register_Ns3DefaultDeleter__Ns3TraceSourceAccessor_methods(root_module, cls):
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor>::DefaultDeleter() [constructor]
cls.add_constructor([])
## default-deleter.h (module 'core'): ns3::DefaultDeleter<ns3::TraceSourceAccessor>::DefaultDeleter(ns3::DefaultDeleter<ns3::TraceSourceAccessor> const & arg0) [constructor]
cls.add_constructor([param('ns3::DefaultDeleter< ns3::TraceSourceAccessor > const &', 'arg0')])
## default-deleter.h (module 'core'): static void ns3::DefaultDeleter<ns3::TraceSourceAccessor>::Delete(ns3::TraceSourceAccessor * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::TraceSourceAccessor *', 'object')],
is_static=True)
return
def register_Ns3EventGarbageCollector_methods(root_module, cls):
## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector::EventGarbageCollector() [constructor]
cls.add_constructor([])
## event-garbage-collector.h (module 'core'): void ns3::EventGarbageCollector::Track(ns3::EventId event) [member function]
cls.add_method('Track',
'void',
[param('ns3::EventId', 'event')])
## event-garbage-collector.h (module 'core'): ns3::EventGarbageCollector::EventGarbageCollector(ns3::EventGarbageCollector const & arg0) [constructor]
cls.add_constructor([param('ns3::EventGarbageCollector const &', 'arg0')])
return
def register_Ns3EventId_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## event-id.h (module 'core'): ns3::EventId::EventId(ns3::EventId const & arg0) [constructor]
cls.add_constructor([param('ns3::EventId const &', 'arg0')])
## event-id.h (module 'core'): ns3::EventId::EventId() [constructor]
cls.add_constructor([])
## event-id.h (module 'core'): ns3::EventId::EventId(ns3::Ptr<ns3::EventImpl> const & impl, uint64_t ts, uint32_t context, uint32_t uid) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::EventImpl > const &', 'impl'), param('uint64_t', 'ts'), param('uint32_t', 'context'), param('uint32_t', 'uid')])
## event-id.h (module 'core'): void ns3::EventId::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-id.h (module 'core'): uint32_t ns3::EventId::GetContext() const [member function]
cls.add_method('GetContext',
'uint32_t',
[],
is_const=True)
## event-id.h (module 'core'): uint64_t ns3::EventId::GetTs() const [member function]
cls.add_method('GetTs',
'uint64_t',
[],
is_const=True)
## event-id.h (module 'core'): uint32_t ns3::EventId::GetUid() const [member function]
cls.add_method('GetUid',
'uint32_t',
[],
is_const=True)
## event-id.h (module 'core'): bool ns3::EventId::IsExpired() const [member function]
cls.add_method('IsExpired',
'bool',
[],
is_const=True)
## event-id.h (module 'core'): bool ns3::EventId::IsRunning() const [member function]
cls.add_method('IsRunning',
'bool',
[],
is_const=True)
## event-id.h (module 'core'): ns3::EventImpl * ns3::EventId::PeekEventImpl() const [member function]
cls.add_method('PeekEventImpl',
'ns3::EventImpl *',
[],
is_const=True)
return
def register_Ns3Hasher_methods(root_module, cls):
## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Hasher const & arg0) [constructor]
cls.add_constructor([param('ns3::Hasher const &', 'arg0')])
## hash.h (module 'core'): ns3::Hasher::Hasher() [constructor]
cls.add_constructor([])
## hash.h (module 'core'): ns3::Hasher::Hasher(ns3::Ptr<ns3::Hash::Implementation> hp) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Hash::Implementation >', 'hp')])
## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')])
## hash.h (module 'core'): uint32_t ns3::Hasher::GetHash32(std::string const s) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('std::string const', 's')])
## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')])
## hash.h (module 'core'): uint64_t ns3::Hasher::GetHash64(std::string const s) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('std::string const', 's')])
## hash.h (module 'core'): ns3::Hasher & ns3::Hasher::clear() [member function]
cls.add_method('clear',
'ns3::Hasher &',
[])
return
def register_Ns3Inet6SocketAddress_methods(root_module, cls):
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Inet6SocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::Inet6SocketAddress const &', 'arg0')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv6Address', 'ipv6'), param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(ns3::Ipv6Address ipv6) [constructor]
cls.add_constructor([param('ns3::Ipv6Address', 'ipv6')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6, uint16_t port) [constructor]
cls.add_constructor([param('char const *', 'ipv6'), param('uint16_t', 'port')])
## inet6-socket-address.h (module 'network'): ns3::Inet6SocketAddress::Inet6SocketAddress(char const * ipv6) [constructor]
cls.add_constructor([param('char const *', 'ipv6')])
## inet6-socket-address.h (module 'network'): static ns3::Inet6SocketAddress ns3::Inet6SocketAddress::ConvertFrom(ns3::Address const & addr) [member function]
cls.add_method('ConvertFrom',
'ns3::Inet6SocketAddress',
[param('ns3::Address const &', 'addr')],
is_static=True)
## inet6-socket-address.h (module 'network'): ns3::Ipv6Address ns3::Inet6SocketAddress::GetIpv6() const [member function]
cls.add_method('GetIpv6',
'ns3::Ipv6Address',
[],
is_const=True)
## inet6-socket-address.h (module 'network'): uint16_t ns3::Inet6SocketAddress::GetPort() const [member function]
cls.add_method('GetPort',
'uint16_t',
[],
is_const=True)
## inet6-socket-address.h (module 'network'): static bool ns3::Inet6SocketAddress::IsMatchingType(ns3::Address const & addr) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'addr')],
is_static=True)
## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetIpv6(ns3::Ipv6Address ipv6) [member function]
cls.add_method('SetIpv6',
'void',
[param('ns3::Ipv6Address', 'ipv6')])
## inet6-socket-address.h (module 'network'): void ns3::Inet6SocketAddress::SetPort(uint16_t port) [member function]
cls.add_method('SetPort',
'void',
[param('uint16_t', 'port')])
return
def register_Ns3InetSocketAddress_methods(root_module, cls):
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::InetSocketAddress const & arg0) [constructor]
cls.add_constructor([param('ns3::InetSocketAddress const &', 'arg0')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4, uint16_t port) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ipv4'), param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(ns3::Ipv4Address ipv4) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'ipv4')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(uint16_t port) [constructor]
cls.add_constructor([param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4, uint16_t port) [constructor]
cls.add_constructor([param('char const *', 'ipv4'), param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): ns3::InetSocketAddress::InetSocketAddress(char const * ipv4) [constructor]
cls.add_constructor([param('char const *', 'ipv4')])
## inet-socket-address.h (module 'network'): static ns3::InetSocketAddress ns3::InetSocketAddress::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::InetSocketAddress',
[param('ns3::Address const &', 'address')],
is_static=True)
## inet-socket-address.h (module 'network'): ns3::Ipv4Address ns3::InetSocketAddress::GetIpv4() const [member function]
cls.add_method('GetIpv4',
'ns3::Ipv4Address',
[],
is_const=True)
## inet-socket-address.h (module 'network'): uint16_t ns3::InetSocketAddress::GetPort() const [member function]
cls.add_method('GetPort',
'uint16_t',
[],
is_const=True)
## inet-socket-address.h (module 'network'): uint8_t ns3::InetSocketAddress::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## inet-socket-address.h (module 'network'): static bool ns3::InetSocketAddress::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetIpv4(ns3::Ipv4Address address) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ipv4Address', 'address')])
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetPort(uint16_t port) [member function]
cls.add_method('SetPort',
'void',
[param('uint16_t', 'port')])
## inet-socket-address.h (module 'network'): void ns3::InetSocketAddress::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
return
def register_Ns3IntToType__0_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<0>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<0>::IntToType(ns3::IntToType<0> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 0 > const &', 'arg0')])
return
def register_Ns3IntToType__1_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<1>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<1>::IntToType(ns3::IntToType<1> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 1 > const &', 'arg0')])
return
def register_Ns3IntToType__2_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<2>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<2>::IntToType(ns3::IntToType<2> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 2 > const &', 'arg0')])
return
def register_Ns3IntToType__3_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<3>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<3>::IntToType(ns3::IntToType<3> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 3 > const &', 'arg0')])
return
def register_Ns3IntToType__4_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<4>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<4>::IntToType(ns3::IntToType<4> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 4 > const &', 'arg0')])
return
def register_Ns3IntToType__5_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<5>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<5>::IntToType(ns3::IntToType<5> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 5 > const &', 'arg0')])
return
def register_Ns3IntToType__6_methods(root_module, cls):
## int-to-type.h (module 'core'): ns3::IntToType<6>::IntToType() [constructor]
cls.add_constructor([])
## int-to-type.h (module 'core'): ns3::IntToType<6>::IntToType(ns3::IntToType<6> const & arg0) [constructor]
cls.add_constructor([param('ns3::IntToType< 6 > const &', 'arg0')])
return
def register_Ns3Ipv4Address_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(ns3::Ipv4Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Address const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(uint32_t address) [constructor]
cls.add_constructor([param('uint32_t', 'address')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address::Ipv4Address(char const * address) [constructor]
cls.add_constructor([param('char const *', 'address')])
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::CombineMask(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('CombineMask',
'ns3::Ipv4Address',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Ipv4Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::Deserialize(uint8_t const * buf) [member function]
cls.add_method('Deserialize',
'ns3::Ipv4Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Address::Get() const [member function]
cls.add_method('Get',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetAny() [member function]
cls.add_method('GetAny',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4Address::GetSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('GetSubnetDirectedBroadcast',
'ns3::Ipv4Address',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Address ns3::Ipv4Address::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv4Address',
[],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsAny() const [member function]
cls.add_method('IsAny',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsEqual(ns3::Ipv4Address const & other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv4Address const &', 'other')],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalMulticast() const [member function]
cls.add_method('IsLocalMulticast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsLocalhost() const [member function]
cls.add_method('IsLocalhost',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): static bool ns3::Ipv4Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Address::IsSubnetDirectedBroadcast(ns3::Ipv4Mask const & mask) const [member function]
cls.add_method('IsSubnetDirectedBroadcast',
'bool',
[param('ns3::Ipv4Mask const &', 'mask')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Serialize(uint8_t * buf) const [member function]
cls.add_method('Serialize',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(uint32_t address) [member function]
cls.add_method('Set',
'void',
[param('uint32_t', 'address')])
## ipv4-address.h (module 'network'): void ns3::Ipv4Address::Set(char const * address) [member function]
cls.add_method('Set',
'void',
[param('char const *', 'address')])
return
def register_Ns3Ipv4InterfaceAddress_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress() [constructor]
cls.add_constructor([])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4Address local, ns3::Ipv4Mask mask) [constructor]
cls.add_constructor([param('ns3::Ipv4Address', 'local'), param('ns3::Ipv4Mask', 'mask')])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::Ipv4InterfaceAddress(ns3::Ipv4InterfaceAddress const & o) [constructor]
cls.add_constructor([param('ns3::Ipv4InterfaceAddress const &', 'o')])
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4InterfaceAddress::GetLocal() const [member function]
cls.add_method('GetLocal',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4Mask ns3::Ipv4InterfaceAddress::GetMask() const [member function]
cls.add_method('GetMask',
'ns3::Ipv4Mask',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e ns3::Ipv4InterfaceAddress::GetScope() const [member function]
cls.add_method('GetScope',
'ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): bool ns3::Ipv4InterfaceAddress::IsSecondary() const [member function]
cls.add_method('IsSecondary',
'bool',
[],
is_const=True)
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetBroadcast(ns3::Ipv4Address broadcast) [member function]
cls.add_method('SetBroadcast',
'void',
[param('ns3::Ipv4Address', 'broadcast')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetLocal(ns3::Ipv4Address local) [member function]
cls.add_method('SetLocal',
'void',
[param('ns3::Ipv4Address', 'local')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetMask(ns3::Ipv4Mask mask) [member function]
cls.add_method('SetMask',
'void',
[param('ns3::Ipv4Mask', 'mask')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetPrimary() [member function]
cls.add_method('SetPrimary',
'void',
[])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetScope(ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function]
cls.add_method('SetScope',
'void',
[param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')])
## ipv4-interface-address.h (module 'internet'): void ns3::Ipv4InterfaceAddress::SetSecondary() [member function]
cls.add_method('SetSecondary',
'void',
[])
return
def register_Ns3Ipv4Mask_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(ns3::Ipv4Mask const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Mask const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(uint32_t mask) [constructor]
cls.add_constructor([param('uint32_t', 'mask')])
## ipv4-address.h (module 'network'): ns3::Ipv4Mask::Ipv4Mask(char const * mask) [constructor]
cls.add_constructor([param('char const *', 'mask')])
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::Get() const [member function]
cls.add_method('Get',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): uint32_t ns3::Ipv4Mask::GetInverse() const [member function]
cls.add_method('GetInverse',
'uint32_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): uint16_t ns3::Ipv4Mask::GetPrefixLength() const [member function]
cls.add_method('GetPrefixLength',
'uint16_t',
[],
is_const=True)
## ipv4-address.h (module 'network'): static ns3::Ipv4Mask ns3::Ipv4Mask::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv4Mask',
[],
is_static=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsEqual(ns3::Ipv4Mask other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv4Mask', 'other')],
is_const=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4Mask::IsMatch(ns3::Ipv4Address a, ns3::Ipv4Address b) const [member function]
cls.add_method('IsMatch',
'bool',
[param('ns3::Ipv4Address', 'a'), param('ns3::Ipv4Address', 'b')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4Mask::Set(uint32_t mask) [member function]
cls.add_method('Set',
'void',
[param('uint32_t', 'mask')])
return
def register_Ns3Ipv4RoutingHelper_methods(root_module, cls):
## ipv4-routing-helper.h (module 'internet'): ns3::Ipv4RoutingHelper::Ipv4RoutingHelper() [constructor]
cls.add_constructor([])
## ipv4-routing-helper.h (module 'internet'): ns3::Ipv4RoutingHelper::Ipv4RoutingHelper(ns3::Ipv4RoutingHelper const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4RoutingHelper const &', 'arg0')])
## ipv4-routing-helper.h (module 'internet'): ns3::Ipv4RoutingHelper * ns3::Ipv4RoutingHelper::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ipv4RoutingHelper *',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4-routing-helper.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4RoutingHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
cls.add_method('PrintNeighborCacheAllAt',
'void',
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
cls.add_method('PrintNeighborCacheAllEvery',
'void',
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
cls.add_method('PrintNeighborCacheAt',
'void',
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintNeighborCacheEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream) [member function]
cls.add_method('PrintNeighborCacheEvery',
'void',
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAllAt(ns3::Time printTime, ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) [member function]
cls.add_method('PrintRoutingTableAllAt',
'void',
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAllEvery(ns3::Time printInterval, ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) [member function]
cls.add_method('PrintRoutingTableAllEvery',
'void',
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableAt(ns3::Time printTime, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) [member function]
cls.add_method('PrintRoutingTableAt',
'void',
[param('ns3::Time', 'printTime'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_static=True)
## ipv4-routing-helper.h (module 'internet'): static void ns3::Ipv4RoutingHelper::PrintRoutingTableEvery(ns3::Time printInterval, ns3::Ptr<ns3::Node> node, ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) [member function]
cls.add_method('PrintRoutingTableEvery',
'void',
[param('ns3::Time', 'printInterval'), param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_static=True)
return
def register_Ns3Ipv6Address_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(char const * address) [constructor]
cls.add_constructor([param('char const *', 'address')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(uint8_t * address) [constructor]
cls.add_constructor([param('uint8_t *', 'address')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const & addr) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const &', 'addr')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address::Ipv6Address(ns3::Ipv6Address const * addr) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const *', 'addr')])
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6Address::CombinePrefix(ns3::Ipv6Prefix const & prefix) [member function]
cls.add_method('CombinePrefix',
'ns3::Ipv6Address',
[param('ns3::Ipv6Prefix const &', 'prefix')])
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Ipv6Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::Deserialize(uint8_t const * buf) [member function]
cls.add_method('Deserialize',
'ns3::Ipv6Address',
[param('uint8_t const *', 'buf')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllHostsMulticast() [member function]
cls.add_method('GetAllHostsMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllNodesMulticast() [member function]
cls.add_method('GetAllNodesMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAllRoutersMulticast() [member function]
cls.add_method('GetAllRoutersMulticast',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetAny() [member function]
cls.add_method('GetAny',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::GetBytes(uint8_t * buf) const [member function]
cls.add_method('GetBytes',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv6Address::GetIpv4MappedAddress() const [member function]
cls.add_method('GetIpv4MappedAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv6Address',
[],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllHostsMulticast() const [member function]
cls.add_method('IsAllHostsMulticast',
'bool',
[],
deprecated=True, is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllNodesMulticast() const [member function]
cls.add_method('IsAllNodesMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAllRoutersMulticast() const [member function]
cls.add_method('IsAllRoutersMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsAny() const [member function]
cls.add_method('IsAny',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsDocumentation() const [member function]
cls.add_method('IsDocumentation',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsEqual(ns3::Ipv6Address const & other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv6Address const &', 'other')],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsIpv4MappedAddress() const [member function]
cls.add_method('IsIpv4MappedAddress',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocal() const [member function]
cls.add_method('IsLinkLocal',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLinkLocalMulticast() const [member function]
cls.add_method('IsLinkLocalMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsLocalhost() const [member function]
cls.add_method('IsLocalhost',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): static bool ns3::Ipv6Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Address::IsSolicitedMulticast() const [member function]
cls.add_method('IsSolicitedMulticast',
'bool',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac16Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac16Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac48Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac48Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac64Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac64Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredAddress(ns3::Mac8Address addr, ns3::Ipv6Address prefix) [member function]
cls.add_method('MakeAutoconfiguredAddress',
'ns3::Ipv6Address',
[param('ns3::Mac8Address', 'addr'), param('ns3::Ipv6Address', 'prefix')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac16Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac16Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac48Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac48Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac64Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac64Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeAutoconfiguredLinkLocalAddress(ns3::Mac8Address mac) [member function]
cls.add_method('MakeAutoconfiguredLinkLocalAddress',
'ns3::Ipv6Address',
[param('ns3::Mac8Address', 'mac')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeIpv4MappedAddress(ns3::Ipv4Address addr) [member function]
cls.add_method('MakeIpv4MappedAddress',
'ns3::Ipv6Address',
[param('ns3::Ipv4Address', 'addr')],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Address ns3::Ipv6Address::MakeSolicitedAddress(ns3::Ipv6Address addr) [member function]
cls.add_method('MakeSolicitedAddress',
'ns3::Ipv6Address',
[param('ns3::Ipv6Address', 'addr')],
is_static=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Serialize(uint8_t * buf) const [member function]
cls.add_method('Serialize',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(char const * address) [member function]
cls.add_method('Set',
'void',
[param('char const *', 'address')])
## ipv6-address.h (module 'network'): void ns3::Ipv6Address::Set(uint8_t * address) [member function]
cls.add_method('Set',
'void',
[param('uint8_t *', 'address')])
return
def register_Ns3Ipv6Prefix_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t * prefix) [constructor]
cls.add_constructor([param('uint8_t *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(char const * prefix) [constructor]
cls.add_constructor([param('char const *', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(uint8_t prefix) [constructor]
cls.add_constructor([param('uint8_t', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const & prefix) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const &', 'prefix')])
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix::Ipv6Prefix(ns3::Ipv6Prefix const * prefix) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const *', 'prefix')])
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::GetBytes(uint8_t * buf) const [member function]
cls.add_method('GetBytes',
'void',
[param('uint8_t *', 'buf')],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetLoopback() [member function]
cls.add_method('GetLoopback',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetOnes() [member function]
cls.add_method('GetOnes',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): uint8_t ns3::Ipv6Prefix::GetPrefixLength() const [member function]
cls.add_method('GetPrefixLength',
'uint8_t',
[],
is_const=True)
## ipv6-address.h (module 'network'): static ns3::Ipv6Prefix ns3::Ipv6Prefix::GetZero() [member function]
cls.add_method('GetZero',
'ns3::Ipv6Prefix',
[],
is_static=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsEqual(ns3::Ipv6Prefix const & other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ipv6Prefix const &', 'other')],
is_const=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6Prefix::IsMatch(ns3::Ipv6Address a, ns3::Ipv6Address b) const [member function]
cls.add_method('IsMatch',
'bool',
[param('ns3::Ipv6Address', 'a'), param('ns3::Ipv6Address', 'b')],
is_const=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6Prefix::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
return
def register_Ns3Mac48Address_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<')
cls.add_output_stream_operator()
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(ns3::Mac48Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48Address const &', 'arg0')])
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48Address::Mac48Address(char const * str) [constructor]
cls.add_constructor([param('char const *', 'str')])
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac48Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyFrom(uint8_t const * buffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'buffer')])
## mac48-address.h (module 'network'): void ns3::Mac48Address::CopyTo(uint8_t * buffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'buffer')],
is_const=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv4Address address) [member function]
cls.add_method('GetMulticast',
'ns3::Mac48Address',
[param('ns3::Ipv4Address', 'address')],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast(ns3::Ipv6Address address) [member function]
cls.add_method('GetMulticast',
'ns3::Mac48Address',
[param('ns3::Ipv6Address', 'address')],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticast6Prefix() [member function]
cls.add_method('GetMulticast6Prefix',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): static ns3::Mac48Address ns3::Mac48Address::GetMulticastPrefix() [member function]
cls.add_method('GetMulticastPrefix',
'ns3::Mac48Address',
[],
is_static=True)
## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_const=True)
## mac48-address.h (module 'network'): bool ns3::Mac48Address::IsGroup() const [member function]
cls.add_method('IsGroup',
'bool',
[],
is_const=True)
## mac48-address.h (module 'network'): static bool ns3::Mac48Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3Mac8Address_methods(root_module, cls):
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_output_stream_operator()
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address(ns3::Mac8Address const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac8Address const &', 'arg0')])
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address() [constructor]
cls.add_constructor([])
## mac8-address.h (module 'network'): ns3::Mac8Address::Mac8Address(uint8_t addr) [constructor]
cls.add_constructor([param('uint8_t', 'addr')])
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::Allocate() [member function]
cls.add_method('Allocate',
'ns3::Mac8Address',
[],
is_static=True)
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::ConvertFrom(ns3::Address const & address) [member function]
cls.add_method('ConvertFrom',
'ns3::Mac8Address',
[param('ns3::Address const &', 'address')],
is_static=True)
## mac8-address.h (module 'network'): void ns3::Mac8Address::CopyFrom(uint8_t const * pBuffer) [member function]
cls.add_method('CopyFrom',
'void',
[param('uint8_t const *', 'pBuffer')])
## mac8-address.h (module 'network'): void ns3::Mac8Address::CopyTo(uint8_t * pBuffer) const [member function]
cls.add_method('CopyTo',
'void',
[param('uint8_t *', 'pBuffer')],
is_const=True)
## mac8-address.h (module 'network'): static ns3::Mac8Address ns3::Mac8Address::GetBroadcast() [member function]
cls.add_method('GetBroadcast',
'ns3::Mac8Address',
[],
is_static=True)
## mac8-address.h (module 'network'): static bool ns3::Mac8Address::IsMatchingType(ns3::Address const & address) [member function]
cls.add_method('IsMatchingType',
'bool',
[param('ns3::Address const &', 'address')],
is_static=True)
return
def register_Ns3NodeContainer_methods(root_module, cls):
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & arg0) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'arg0')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer() [constructor]
cls.add_constructor([])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::Ptr<ns3::Node> node) [constructor]
cls.add_constructor([param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(std::string nodeName) [constructor]
cls.add_constructor([param('std::string', 'nodeName')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd')])
## node-container.h (module 'network'): ns3::NodeContainer::NodeContainer(ns3::NodeContainer const & a, ns3::NodeContainer const & b, ns3::NodeContainer const & c, ns3::NodeContainer const & d, ns3::NodeContainer const & e) [constructor]
cls.add_constructor([param('ns3::NodeContainer const &', 'a'), param('ns3::NodeContainer const &', 'b'), param('ns3::NodeContainer const &', 'c'), param('ns3::NodeContainer const &', 'd'), param('ns3::NodeContainer const &', 'e')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::NodeContainer other) [member function]
cls.add_method('Add',
'void',
[param('ns3::NodeContainer', 'other')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('Add',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')])
## node-container.h (module 'network'): void ns3::NodeContainer::Add(std::string nodeName) [member function]
cls.add_method('Add',
'void',
[param('std::string', 'nodeName')])
## node-container.h (module 'network'): ns3::NodeContainer::Iterator ns3::NodeContainer::Begin() const [member function]
cls.add_method('Begin',
'ns3::NodeContainer::Iterator',
[],
is_const=True)
## node-container.h (module 'network'): bool ns3::NodeContainer::Contains(uint32_t id) const [member function]
cls.add_method('Contains',
'bool',
[param('uint32_t', 'id')],
is_const=True)
## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n')])
## node-container.h (module 'network'): void ns3::NodeContainer::Create(uint32_t n, uint32_t systemId) [member function]
cls.add_method('Create',
'void',
[param('uint32_t', 'n'), param('uint32_t', 'systemId')])
## node-container.h (module 'network'): ns3::NodeContainer::Iterator ns3::NodeContainer::End() const [member function]
cls.add_method('End',
'ns3::NodeContainer::Iterator',
[],
is_const=True)
## node-container.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NodeContainer::Get(uint32_t i) const [member function]
cls.add_method('Get',
'ns3::Ptr< ns3::Node >',
[param('uint32_t', 'i')],
is_const=True)
## node-container.h (module 'network'): static ns3::NodeContainer ns3::NodeContainer::GetGlobal() [member function]
cls.add_method('GetGlobal',
'ns3::NodeContainer',
[],
is_static=True)
## node-container.h (module 'network'): uint32_t ns3::NodeContainer::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
return
def register_Ns3NonCopyable_methods(root_module, cls):
## non-copyable.h (module 'core'): ns3::NonCopyable::NonCopyable() [constructor]
cls.add_constructor([],
visibility='protected')
return
def register_Ns3ObjectBase_methods(root_module, cls):
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase() [constructor]
cls.add_constructor([])
## object-base.h (module 'core'): ns3::ObjectBase::ObjectBase(ns3::ObjectBase const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectBase const &', 'arg0')])
## object-base.h (module 'core'): void ns3::ObjectBase::GetAttribute(std::string name, ns3::AttributeValue & value) const [member function]
cls.add_method('GetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
is_const=True)
## object-base.h (module 'core'): bool ns3::ObjectBase::GetAttributeFailSafe(std::string name, ns3::AttributeValue & value) const [member function]
cls.add_method('GetAttributeFailSafe',
'bool',
[param('std::string', 'name'), param('ns3::AttributeValue &', 'value')],
is_const=True)
## object-base.h (module 'core'): ns3::TypeId ns3::ObjectBase::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## object-base.h (module 'core'): static ns3::TypeId ns3::ObjectBase::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## object-base.h (module 'core'): void ns3::ObjectBase::SetAttribute(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttribute',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-base.h (module 'core'): bool ns3::ObjectBase::SetAttributeFailSafe(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('SetAttributeFailSafe',
'bool',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceConnect',
'bool',
[param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceConnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceConnectWithoutContext',
'bool',
[param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnect(std::string name, std::string context, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceDisconnect',
'bool',
[param('std::string', 'name'), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): bool ns3::ObjectBase::TraceDisconnectWithoutContext(std::string name, ns3::CallbackBase const & cb) [member function]
cls.add_method('TraceDisconnectWithoutContext',
'bool',
[param('std::string', 'name'), param('ns3::CallbackBase const &', 'cb')])
## object-base.h (module 'core'): void ns3::ObjectBase::ConstructSelf(ns3::AttributeConstructionList const & attributes) [member function]
cls.add_method('ConstructSelf',
'void',
[param('ns3::AttributeConstructionList const &', 'attributes')],
visibility='protected')
## object-base.h (module 'core'): void ns3::ObjectBase::NotifyConstructionCompleted() [member function]
cls.add_method('NotifyConstructionCompleted',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3ObjectDeleter_methods(root_module, cls):
## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter() [constructor]
cls.add_constructor([])
## object.h (module 'core'): ns3::ObjectDeleter::ObjectDeleter(ns3::ObjectDeleter const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectDeleter const &', 'arg0')])
## object.h (module 'core'): static void ns3::ObjectDeleter::Delete(ns3::Object * object) [member function]
cls.add_method('Delete',
'void',
[param('ns3::Object *', 'object')],
is_static=True)
return
def register_Ns3ObjectFactory_methods(root_module, cls):
cls.add_output_stream_operator()
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(ns3::ObjectFactory const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactory const &', 'arg0')])
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactory::ObjectFactory(std::string typeId) [constructor]
cls.add_constructor([param('std::string', 'typeId')])
## object-factory.h (module 'core'): ns3::Ptr<ns3::Object> ns3::ObjectFactory::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::Object >',
[],
is_const=True)
## object-factory.h (module 'core'): ns3::TypeId ns3::ObjectFactory::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
## object-factory.h (module 'core'): void ns3::ObjectFactory::Set(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('Set',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(ns3::TypeId tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('ns3::TypeId', 'tid')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(char const * tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('char const *', 'tid')])
## object-factory.h (module 'core'): void ns3::ObjectFactory::SetTypeId(std::string tid) [member function]
cls.add_method('SetTypeId',
'void',
[param('std::string', 'tid')])
return
def register_Ns3OlsrHelper_methods(root_module, cls):
## olsr-helper.h (module 'olsr'): ns3::OlsrHelper::OlsrHelper() [constructor]
cls.add_constructor([])
## olsr-helper.h (module 'olsr'): ns3::OlsrHelper::OlsrHelper(ns3::OlsrHelper const & arg0) [constructor]
cls.add_constructor([param('ns3::OlsrHelper const &', 'arg0')])
## olsr-helper.h (module 'olsr'): ns3::OlsrHelper * ns3::OlsrHelper::Copy() const [member function]
cls.add_method('Copy',
'ns3::OlsrHelper *',
[],
is_const=True, is_virtual=True)
## olsr-helper.h (module 'olsr'): void ns3::OlsrHelper::ExcludeInterface(ns3::Ptr<ns3::Node> node, uint32_t interface) [member function]
cls.add_method('ExcludeInterface',
'void',
[param('ns3::Ptr< ns3::Node >', 'node'), param('uint32_t', 'interface')])
## olsr-helper.h (module 'olsr'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::OlsrHelper::Create(ns3::Ptr<ns3::Node> node) const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_const=True, is_virtual=True)
## olsr-helper.h (module 'olsr'): void ns3::OlsrHelper::Set(std::string name, ns3::AttributeValue const & value) [member function]
cls.add_method('Set',
'void',
[param('std::string', 'name'), param('ns3::AttributeValue const &', 'value')])
## olsr-helper.h (module 'olsr'): int64_t ns3::OlsrHelper::AssignStreams(ns3::NodeContainer c, int64_t stream) [member function]
cls.add_method('AssignStreams',
'int64_t',
[param('ns3::NodeContainer', 'c'), param('int64_t', 'stream')])
return
def register_Ns3PacketMetadata_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(uint64_t uid, uint32_t size) [constructor]
cls.add_constructor([param('uint64_t', 'uid'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::PacketMetadata(ns3::PacketMetadata const & o) [constructor]
cls.add_constructor([param('ns3::PacketMetadata const &', 'o')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddAtEnd(ns3::PacketMetadata const & o) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::PacketMetadata const &', 'o')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddHeader(ns3::Header const & header, uint32_t size) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Header const &', 'header'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddPaddingAtEnd(uint32_t end) [member function]
cls.add_method('AddPaddingAtEnd',
'void',
[param('uint32_t', 'end')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::AddTrailer(ns3::Trailer const & trailer, uint32_t size) [member function]
cls.add_method('AddTrailer',
'void',
[param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::PacketMetadata::BeginItem(ns3::Buffer buffer) const [member function]
cls.add_method('BeginItem',
'ns3::PacketMetadata::ItemIterator',
[param('ns3::Buffer', 'buffer')],
is_const=True)
## packet-metadata.h (module 'network'): ns3::PacketMetadata ns3::PacketMetadata::CreateFragment(uint32_t start, uint32_t end) const [member function]
cls.add_method('CreateFragment',
'ns3::PacketMetadata',
[param('uint32_t', 'start'), param('uint32_t', 'end')],
is_const=True)
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Deserialize(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::Enable() [member function]
cls.add_method('Enable',
'void',
[],
is_static=True)
## packet-metadata.h (module 'network'): static void ns3::PacketMetadata::EnableChecking() [member function]
cls.add_method('EnableChecking',
'void',
[],
is_static=True)
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet-metadata.h (module 'network'): uint64_t ns3::PacketMetadata::GetUid() const [member function]
cls.add_method('GetUid',
'uint64_t',
[],
is_const=True)
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtEnd(uint32_t end) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'end')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveAtStart(uint32_t start) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'start')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveHeader(ns3::Header const & header, uint32_t size) [member function]
cls.add_method('RemoveHeader',
'void',
[param('ns3::Header const &', 'header'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): void ns3::PacketMetadata::RemoveTrailer(ns3::Trailer const & trailer, uint32_t size) [member function]
cls.add_method('RemoveTrailer',
'void',
[param('ns3::Trailer const &', 'trailer'), param('uint32_t', 'size')])
## packet-metadata.h (module 'network'): uint32_t ns3::PacketMetadata::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3PacketMetadataItem_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item() [constructor]
cls.add_constructor([])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::Item(ns3::PacketMetadata::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketMetadata::Item const &', 'arg0')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::current [variable]
cls.add_instance_attribute('current', 'ns3::Buffer::Iterator', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentSize [variable]
cls.add_instance_attribute('currentSize', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromEnd [variable]
cls.add_instance_attribute('currentTrimedFromEnd', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::currentTrimedFromStart [variable]
cls.add_instance_attribute('currentTrimedFromStart', 'uint32_t', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::isFragment [variable]
cls.add_instance_attribute('isFragment', 'bool', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item::type [variable]
cls.add_instance_attribute('type', 'ns3::PacketMetadata::Item::ItemType', is_const=False)
return
def register_Ns3PacketMetadataItemIterator_methods(root_module, cls):
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata::ItemIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketMetadata::ItemIterator const &', 'arg0')])
## packet-metadata.h (module 'network'): ns3::PacketMetadata::ItemIterator::ItemIterator(ns3::PacketMetadata const * metadata, ns3::Buffer buffer) [constructor]
cls.add_constructor([param('ns3::PacketMetadata const *', 'metadata'), param('ns3::Buffer', 'buffer')])
## packet-metadata.h (module 'network'): bool ns3::PacketMetadata::ItemIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet-metadata.h (module 'network'): ns3::PacketMetadata::Item ns3::PacketMetadata::ItemIterator::Next() [member function]
cls.add_method('Next',
'ns3::PacketMetadata::Item',
[])
return
def register_Ns3PacketTagIterator_methods(root_module, cls):
## packet.h (module 'network'): ns3::PacketTagIterator::PacketTagIterator(ns3::PacketTagIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagIterator const &', 'arg0')])
## packet.h (module 'network'): bool ns3::PacketTagIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## packet.h (module 'network'): ns3::PacketTagIterator::Item ns3::PacketTagIterator::Next() [member function]
cls.add_method('Next',
'ns3::PacketTagIterator::Item',
[])
return
def register_Ns3PacketTagIteratorItem_methods(root_module, cls):
## packet.h (module 'network'): ns3::PacketTagIterator::Item::Item(ns3::PacketTagIterator::Item const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagIterator::Item const &', 'arg0')])
## packet.h (module 'network'): void ns3::PacketTagIterator::Item::GetTag(ns3::Tag & tag) const [member function]
cls.add_method('GetTag',
'void',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::TypeId ns3::PacketTagIterator::Item::GetTypeId() const [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_const=True)
return
def register_Ns3PacketTagList_methods(root_module, cls):
## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList() [constructor]
cls.add_constructor([])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::PacketTagList(ns3::PacketTagList const & o) [constructor]
cls.add_constructor([param('ns3::PacketTagList const &', 'o')])
## packet-tag-list.h (module 'network'): void ns3::PacketTagList::Add(ns3::Tag const & tag) const [member function]
cls.add_method('Add',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData const * ns3::PacketTagList::Head() const [member function]
cls.add_method('Head',
'ns3::PacketTagList::TagData const *',
[],
is_const=True)
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Peek(ns3::Tag & tag) const [member function]
cls.add_method('Peek',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Remove(ns3::Tag & tag) [member function]
cls.add_method('Remove',
'bool',
[param('ns3::Tag &', 'tag')])
## packet-tag-list.h (module 'network'): void ns3::PacketTagList::RemoveAll() [member function]
cls.add_method('RemoveAll',
'void',
[])
## packet-tag-list.h (module 'network'): bool ns3::PacketTagList::Replace(ns3::Tag & tag) [member function]
cls.add_method('Replace',
'bool',
[param('ns3::Tag &', 'tag')])
return
def register_Ns3PacketTagListTagData_methods(root_module, cls):
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData() [constructor]
cls.add_constructor([])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::TagData(ns3::PacketTagList::TagData const & arg0) [constructor]
cls.add_constructor([param('ns3::PacketTagList::TagData const &', 'arg0')])
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::count [variable]
cls.add_instance_attribute('count', 'uint32_t', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::data [variable]
cls.add_instance_attribute('data', 'uint8_t [ 1 ]', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::next [variable]
cls.add_instance_attribute('next', 'ns3::PacketTagList::TagData *', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::size [variable]
cls.add_instance_attribute('size', 'uint32_t', is_const=False)
## packet-tag-list.h (module 'network'): ns3::PacketTagList::TagData::tid [variable]
cls.add_instance_attribute('tid', 'ns3::TypeId', is_const=False)
return
def register_Ns3SimpleRefCount__Ns3Object_Ns3ObjectBase_Ns3ObjectDeleter_methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter>::SimpleRefCount(ns3::SimpleRefCount<ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter> const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Object, ns3::ObjectBase, ns3::ObjectDeleter > const &', 'o')])
return
def register_Ns3Simulator_methods(root_module, cls):
## simulator.h (module 'core'): ns3::Simulator::Simulator(ns3::Simulator const & arg0) [constructor]
cls.add_constructor([param('ns3::Simulator const &', 'arg0')])
## simulator.h (module 'core'): static void ns3::Simulator::Cancel(ns3::EventId const & id) [member function]
cls.add_method('Cancel',
'void',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Destroy() [member function]
cls.add_method('Destroy',
'void',
[],
is_static=True)
## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetContext() [member function]
cls.add_method('GetContext',
'uint32_t',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetDelayLeft(ns3::EventId const & id) [member function]
cls.add_method('GetDelayLeft',
'ns3::Time',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static ns3::Ptr<ns3::SimulatorImpl> ns3::Simulator::GetImplementation() [member function]
cls.add_method('GetImplementation',
'ns3::Ptr< ns3::SimulatorImpl >',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::GetMaximumSimulationTime() [member function]
cls.add_method('GetMaximumSimulationTime',
'ns3::Time',
[],
is_static=True)
## simulator.h (module 'core'): static uint32_t ns3::Simulator::GetSystemId() [member function]
cls.add_method('GetSystemId',
'uint32_t',
[],
is_static=True)
## simulator.h (module 'core'): static bool ns3::Simulator::IsExpired(ns3::EventId const & id) [member function]
cls.add_method('IsExpired',
'bool',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static bool ns3::Simulator::IsFinished() [member function]
cls.add_method('IsFinished',
'bool',
[],
is_static=True)
## simulator.h (module 'core'): static ns3::Time ns3::Simulator::Now() [member function]
cls.add_method('Now',
'ns3::Time',
[],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Remove(ns3::EventId const & id) [member function]
cls.add_method('Remove',
'void',
[param('ns3::EventId const &', 'id')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::SetImplementation(ns3::Ptr<ns3::SimulatorImpl> impl) [member function]
cls.add_method('SetImplementation',
'void',
[param('ns3::Ptr< ns3::SimulatorImpl >', 'impl')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::SetScheduler(ns3::ObjectFactory schedulerFactory) [member function]
cls.add_method('SetScheduler',
'void',
[param('ns3::ObjectFactory', 'schedulerFactory')],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Stop() [member function]
cls.add_method('Stop',
'void',
[],
is_static=True)
## simulator.h (module 'core'): static void ns3::Simulator::Stop(ns3::Time const & delay) [member function]
cls.add_method('Stop',
'void',
[param('ns3::Time const &', 'delay')],
is_static=True)
return
def register_Ns3SystemWallClockMs_methods(root_module, cls):
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs(ns3::SystemWallClockMs const & arg0) [constructor]
cls.add_constructor([param('ns3::SystemWallClockMs const &', 'arg0')])
## system-wall-clock-ms.h (module 'core'): ns3::SystemWallClockMs::SystemWallClockMs() [constructor]
cls.add_constructor([])
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::End() [member function]
cls.add_method('End',
'int64_t',
[])
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedReal() const [member function]
cls.add_method('GetElapsedReal',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedSystem() const [member function]
cls.add_method('GetElapsedSystem',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): int64_t ns3::SystemWallClockMs::GetElapsedUser() const [member function]
cls.add_method('GetElapsedUser',
'int64_t',
[],
is_const=True)
## system-wall-clock-ms.h (module 'core'): void ns3::SystemWallClockMs::Start() [member function]
cls.add_method('Start',
'void',
[])
return
def register_Ns3Tag_methods(root_module, cls):
## tag.h (module 'network'): ns3::Tag::Tag() [constructor]
cls.add_constructor([])
## tag.h (module 'network'): ns3::Tag::Tag(ns3::Tag const & arg0) [constructor]
cls.add_constructor([param('ns3::Tag const &', 'arg0')])
## tag.h (module 'network'): void ns3::Tag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_pure_virtual=True, is_virtual=True)
## tag.h (module 'network'): uint32_t ns3::Tag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## tag.h (module 'network'): static ns3::TypeId ns3::Tag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## tag.h (module 'network'): void ns3::Tag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## tag.h (module 'network'): void ns3::Tag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3TagBuffer_methods(root_module, cls):
## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(ns3::TagBuffer const & arg0) [constructor]
cls.add_constructor([param('ns3::TagBuffer const &', 'arg0')])
## tag-buffer.h (module 'network'): ns3::TagBuffer::TagBuffer(uint8_t * start, uint8_t * end) [constructor]
cls.add_constructor([param('uint8_t *', 'start'), param('uint8_t *', 'end')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::CopyFrom(ns3::TagBuffer o) [member function]
cls.add_method('CopyFrom',
'void',
[param('ns3::TagBuffer', 'o')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::Read(uint8_t * buffer, uint32_t size) [member function]
cls.add_method('Read',
'void',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')])
## tag-buffer.h (module 'network'): double ns3::TagBuffer::ReadDouble() [member function]
cls.add_method('ReadDouble',
'double',
[])
## tag-buffer.h (module 'network'): uint16_t ns3::TagBuffer::ReadU16() [member function]
cls.add_method('ReadU16',
'uint16_t',
[])
## tag-buffer.h (module 'network'): uint32_t ns3::TagBuffer::ReadU32() [member function]
cls.add_method('ReadU32',
'uint32_t',
[])
## tag-buffer.h (module 'network'): uint64_t ns3::TagBuffer::ReadU64() [member function]
cls.add_method('ReadU64',
'uint64_t',
[])
## tag-buffer.h (module 'network'): uint8_t ns3::TagBuffer::ReadU8() [member function]
cls.add_method('ReadU8',
'uint8_t',
[])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::TrimAtEnd(uint32_t trim) [member function]
cls.add_method('TrimAtEnd',
'void',
[param('uint32_t', 'trim')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::Write(uint8_t const * buffer, uint32_t size) [member function]
cls.add_method('Write',
'void',
[param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteDouble(double v) [member function]
cls.add_method('WriteDouble',
'void',
[param('double', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU16(uint16_t v) [member function]
cls.add_method('WriteU16',
'void',
[param('uint16_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU32(uint32_t v) [member function]
cls.add_method('WriteU32',
'void',
[param('uint32_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU64(uint64_t v) [member function]
cls.add_method('WriteU64',
'void',
[param('uint64_t', 'v')])
## tag-buffer.h (module 'network'): void ns3::TagBuffer::WriteU8(uint8_t v) [member function]
cls.add_method('WriteU8',
'void',
[param('uint8_t', 'v')])
return
def register_Ns3TimeWithUnit_methods(root_module, cls):
cls.add_output_stream_operator()
## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::TimeWithUnit const & arg0) [constructor]
cls.add_constructor([param('ns3::TimeWithUnit const &', 'arg0')])
## nstime.h (module 'core'): ns3::TimeWithUnit::TimeWithUnit(ns3::Time const time, ns3::Time::Unit const unit) [constructor]
cls.add_constructor([param('ns3::Time const', 'time'), param('ns3::Time::Unit const', 'unit')])
return
def register_Ns3Timer_methods(root_module, cls):
## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer const & arg0) [constructor]
cls.add_constructor([param('ns3::Timer const &', 'arg0')])
## timer.h (module 'core'): ns3::Timer::Timer() [constructor]
cls.add_constructor([])
## timer.h (module 'core'): ns3::Timer::Timer(ns3::Timer::DestroyPolicy destroyPolicy) [constructor]
cls.add_constructor([param('ns3::Timer::DestroyPolicy', 'destroyPolicy')])
## timer.h (module 'core'): void ns3::Timer::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## timer.h (module 'core'): ns3::Time ns3::Timer::GetDelay() const [member function]
cls.add_method('GetDelay',
'ns3::Time',
[],
is_const=True)
## timer.h (module 'core'): ns3::Time ns3::Timer::GetDelayLeft() const [member function]
cls.add_method('GetDelayLeft',
'ns3::Time',
[],
is_const=True)
## timer.h (module 'core'): ns3::Timer::State ns3::Timer::GetState() const [member function]
cls.add_method('GetState',
'ns3::Timer::State',
[],
is_const=True)
## timer.h (module 'core'): bool ns3::Timer::IsExpired() const [member function]
cls.add_method('IsExpired',
'bool',
[],
is_const=True)
## timer.h (module 'core'): bool ns3::Timer::IsRunning() const [member function]
cls.add_method('IsRunning',
'bool',
[],
is_const=True)
## timer.h (module 'core'): bool ns3::Timer::IsSuspended() const [member function]
cls.add_method('IsSuspended',
'bool',
[],
is_const=True)
## timer.h (module 'core'): void ns3::Timer::Remove() [member function]
cls.add_method('Remove',
'void',
[])
## timer.h (module 'core'): void ns3::Timer::Resume() [member function]
cls.add_method('Resume',
'void',
[])
## timer.h (module 'core'): void ns3::Timer::Schedule() [member function]
cls.add_method('Schedule',
'void',
[])
## timer.h (module 'core'): void ns3::Timer::Schedule(ns3::Time delay) [member function]
cls.add_method('Schedule',
'void',
[param('ns3::Time', 'delay')])
## timer.h (module 'core'): void ns3::Timer::SetDelay(ns3::Time const & delay) [member function]
cls.add_method('SetDelay',
'void',
[param('ns3::Time const &', 'delay')])
## timer.h (module 'core'): void ns3::Timer::Suspend() [member function]
cls.add_method('Suspend',
'void',
[])
return
def register_Ns3TimerImpl_methods(root_module, cls):
## timer-impl.h (module 'core'): ns3::TimerImpl::TimerImpl() [constructor]
cls.add_constructor([])
## timer-impl.h (module 'core'): ns3::TimerImpl::TimerImpl(ns3::TimerImpl const & arg0) [constructor]
cls.add_constructor([param('ns3::TimerImpl const &', 'arg0')])
## timer-impl.h (module 'core'): void ns3::TimerImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[],
is_pure_virtual=True, is_virtual=True)
## timer-impl.h (module 'core'): ns3::EventId ns3::TimerImpl::Schedule(ns3::Time const & delay) [member function]
cls.add_method('Schedule',
'ns3::EventId',
[param('ns3::Time const &', 'delay')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3TypeId_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('<')
## type-id.h (module 'core'): ns3::TypeId::TypeId(char const * name) [constructor]
cls.add_constructor([param('char const *', 'name')])
## type-id.h (module 'core'): ns3::TypeId::TypeId() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::TypeId(ns3::TypeId const & o) [constructor]
cls.add_constructor([param('ns3::TypeId const &', 'o')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, ns3::AttributeValue const & initialValue, ns3::Ptr<const ns3::AttributeAccessor> accessor, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddAttribute(std::string name, std::string help, uint32_t flags, ns3::AttributeValue const & initialValue, ns3::Ptr<const ns3::AttributeAccessor> accessor, ns3::Ptr<const ns3::AttributeChecker> checker, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddAttribute',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('uint32_t', 'flags'), param('ns3::AttributeValue const &', 'initialValue'), param('ns3::Ptr< ns3::AttributeAccessor const >', 'accessor'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<const ns3::TraceSourceAccessor> accessor) [member function]
cls.add_method('AddTraceSource',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor')],
deprecated=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::AddTraceSource(std::string name, std::string help, ns3::Ptr<const ns3::TraceSourceAccessor> accessor, std::string callback, ns3::TypeId::SupportLevel supportLevel=::ns3::TypeId::SupportLevel::SUPPORTED, std::string const & supportMsg="") [member function]
cls.add_method('AddTraceSource',
'ns3::TypeId',
[param('std::string', 'name'), param('std::string', 'help'), param('ns3::Ptr< ns3::TraceSourceAccessor const >', 'accessor'), param('std::string', 'callback'), param('ns3::TypeId::SupportLevel', 'supportLevel', default_value='::ns3::TypeId::SupportLevel::SUPPORTED'), param('std::string const &', 'supportMsg', default_value='""')])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation ns3::TypeId::GetAttribute(std::size_t i) const [member function]
cls.add_method('GetAttribute',
'ns3::TypeId::AttributeInformation',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetAttributeFullName(std::size_t i) const [member function]
cls.add_method('GetAttributeFullName',
'std::string',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetAttributeN() const [member function]
cls.add_method('GetAttributeN',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): ns3::Callback<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> ns3::TypeId::GetConstructor() const [member function]
cls.add_method('GetConstructor',
'ns3::Callback< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetGroupName() const [member function]
cls.add_method('GetGroupName',
'std::string',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId::hash_t ns3::TypeId::GetHash() const [member function]
cls.add_method('GetHash',
'ns3::TypeId::hash_t',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeId::GetName() const [member function]
cls.add_method('GetName',
'std::string',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::GetParent() const [member function]
cls.add_method('GetParent',
'ns3::TypeId',
[],
is_const=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::GetRegistered(uint16_t i) [member function]
cls.add_method('GetRegistered',
'ns3::TypeId',
[param('uint16_t', 'i')],
is_static=True)
## type-id.h (module 'core'): static uint16_t ns3::TypeId::GetRegisteredN() [member function]
cls.add_method('GetRegisteredN',
'uint16_t',
[],
is_static=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetSize() const [member function]
cls.add_method('GetSize',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation ns3::TypeId::GetTraceSource(std::size_t i) const [member function]
cls.add_method('GetTraceSource',
'ns3::TypeId::TraceSourceInformation',
[param('std::size_t', 'i')],
is_const=True)
## type-id.h (module 'core'): std::size_t ns3::TypeId::GetTraceSourceN() const [member function]
cls.add_method('GetTraceSourceN',
'std::size_t',
[],
is_const=True)
## type-id.h (module 'core'): uint16_t ns3::TypeId::GetUid() const [member function]
cls.add_method('GetUid',
'uint16_t',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::HasConstructor() const [member function]
cls.add_method('HasConstructor',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::HasParent() const [member function]
cls.add_method('HasParent',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::HideFromDocumentation() [member function]
cls.add_method('HideFromDocumentation',
'ns3::TypeId',
[])
## type-id.h (module 'core'): bool ns3::TypeId::IsChildOf(ns3::TypeId other) const [member function]
cls.add_method('IsChildOf',
'bool',
[param('ns3::TypeId', 'other')],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::LookupAttributeByName(std::string name, ns3::TypeId::AttributeInformation * info) const [member function]
cls.add_method('LookupAttributeByName',
'bool',
[param('std::string', 'name'), param('ns3::TypeId::AttributeInformation *', 'info', transfer_ownership=False)],
is_const=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByHash(ns3::TypeId::hash_t hash) [member function]
cls.add_method('LookupByHash',
'ns3::TypeId',
[param('uint32_t', 'hash')],
is_static=True)
## type-id.h (module 'core'): static bool ns3::TypeId::LookupByHashFailSafe(ns3::TypeId::hash_t hash, ns3::TypeId * tid) [member function]
cls.add_method('LookupByHashFailSafe',
'bool',
[param('uint32_t', 'hash'), param('ns3::TypeId *', 'tid')],
is_static=True)
## type-id.h (module 'core'): static ns3::TypeId ns3::TypeId::LookupByName(std::string name) [member function]
cls.add_method('LookupByName',
'ns3::TypeId',
[param('std::string', 'name')],
is_static=True)
## type-id.h (module 'core'): ns3::Ptr<const ns3::TraceSourceAccessor> ns3::TypeId::LookupTraceSourceByName(std::string name) const [member function]
cls.add_method('LookupTraceSourceByName',
'ns3::Ptr< ns3::TraceSourceAccessor const >',
[param('std::string', 'name')],
is_const=True)
## type-id.h (module 'core'): ns3::Ptr<const ns3::TraceSourceAccessor> ns3::TypeId::LookupTraceSourceByName(std::string name, ns3::TypeId::TraceSourceInformation * info) const [member function]
cls.add_method('LookupTraceSourceByName',
'ns3::Ptr< ns3::TraceSourceAccessor const >',
[param('std::string', 'name'), param('ns3::TypeId::TraceSourceInformation *', 'info')],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::MustHideFromDocumentation() const [member function]
cls.add_method('MustHideFromDocumentation',
'bool',
[],
is_const=True)
## type-id.h (module 'core'): bool ns3::TypeId::SetAttributeInitialValue(std::size_t i, ns3::Ptr<const ns3::AttributeValue> initialValue) [member function]
cls.add_method('SetAttributeInitialValue',
'bool',
[param('std::size_t', 'i'), param('ns3::Ptr< ns3::AttributeValue const >', 'initialValue')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetGroupName(std::string groupName) [member function]
cls.add_method('SetGroupName',
'ns3::TypeId',
[param('std::string', 'groupName')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetParent(ns3::TypeId tid) [member function]
cls.add_method('SetParent',
'ns3::TypeId',
[param('ns3::TypeId', 'tid')])
## type-id.h (module 'core'): ns3::TypeId ns3::TypeId::SetSize(std::size_t size) [member function]
cls.add_method('SetSize',
'ns3::TypeId',
[param('std::size_t', 'size')])
## type-id.h (module 'core'): void ns3::TypeId::SetUid(uint16_t uid) [member function]
cls.add_method('SetUid',
'void',
[param('uint16_t', 'uid')])
return
def register_Ns3TypeIdAttributeInformation_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::AttributeInformation(ns3::TypeId::AttributeInformation const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeId::AttributeInformation const &', 'arg0')])
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::accessor [variable]
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::AttributeAccessor const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::checker [variable]
cls.add_instance_attribute('checker', 'ns3::Ptr< ns3::AttributeChecker const >', is_const=False)
cls.add_instance_attribute('flags', 'uint32_t', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::help [variable]
cls.add_instance_attribute('help', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::initialValue [variable]
cls.add_instance_attribute('initialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::originalInitialValue [variable]
cls.add_instance_attribute('originalInitialValue', 'ns3::Ptr< ns3::AttributeValue const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::supportLevel [variable]
cls.add_instance_attribute('supportLevel', 'ns3::TypeId::SupportLevel', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::AttributeInformation::supportMsg [variable]
cls.add_instance_attribute('supportMsg', 'std::string', is_const=False)
return
def register_Ns3TypeIdTraceSourceInformation_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::TraceSourceInformation(ns3::TypeId::TraceSourceInformation const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeId::TraceSourceInformation const &', 'arg0')])
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::accessor [variable]
cls.add_instance_attribute('accessor', 'ns3::Ptr< ns3::TraceSourceAccessor const >', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::callback [variable]
cls.add_instance_attribute('callback', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::help [variable]
cls.add_instance_attribute('help', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::name [variable]
cls.add_instance_attribute('name', 'std::string', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::supportLevel [variable]
cls.add_instance_attribute('supportLevel', 'ns3::TypeId::SupportLevel', is_const=False)
## type-id.h (module 'core'): ns3::TypeId::TraceSourceInformation::supportMsg [variable]
cls.add_instance_attribute('supportMsg', 'std::string', is_const=False)
return
def register_Ns3Empty_methods(root_module, cls):
## empty.h (module 'core'): ns3::empty::empty() [constructor]
cls.add_constructor([])
## empty.h (module 'core'): ns3::empty::empty(ns3::empty const & arg0) [constructor]
cls.add_constructor([param('ns3::empty const &', 'arg0')])
return
def register_Ns3Int64x64_t_methods(root_module, cls):
cls.add_binary_numeric_operator('+', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::int64x64_t'], root_module['ns3::int64x64_t'], param('ns3::int64x64_t const &', u'right'))
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('>=')
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_inplace_numeric_operator('+=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('*=', param('ns3::int64x64_t const &', u'right'))
cls.add_inplace_numeric_operator('/=', param('ns3::int64x64_t const &', u'right'))
cls.add_unary_numeric_operator('-')
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t() [constructor]
cls.add_constructor([])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(double const value) [constructor]
cls.add_constructor([param('double const', 'value')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long double const value) [constructor]
cls.add_constructor([param('long double const', 'value')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(int const v) [constructor]
cls.add_constructor([param('int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long int const v) [constructor]
cls.add_constructor([param('long int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long long int const v) [constructor]
cls.add_constructor([param('long long int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(unsigned int const v) [constructor]
cls.add_constructor([param('unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long unsigned int const v) [constructor]
cls.add_constructor([param('long unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(long long unsigned int const v) [constructor]
cls.add_constructor([param('long long unsigned int const', 'v')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(int64_t const hi, uint64_t const lo) [constructor]
cls.add_constructor([param('int64_t const', 'hi'), param('uint64_t const', 'lo')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::int64x64_t(ns3::int64x64_t const & o) [constructor]
cls.add_constructor([param('ns3::int64x64_t const &', 'o')])
## int64x64-128.h (module 'core'): double ns3::int64x64_t::GetDouble() const [member function]
cls.add_method('GetDouble',
'double',
[],
is_const=True)
## int64x64-128.h (module 'core'): int64_t ns3::int64x64_t::GetHigh() const [member function]
cls.add_method('GetHigh',
'int64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): uint64_t ns3::int64x64_t::GetLow() const [member function]
cls.add_method('GetLow',
'uint64_t',
[],
is_const=True)
## int64x64-128.h (module 'core'): static ns3::int64x64_t ns3::int64x64_t::Invert(uint64_t const v) [member function]
cls.add_method('Invert',
'ns3::int64x64_t',
[param('uint64_t const', 'v')],
is_static=True)
## int64x64-128.h (module 'core'): void ns3::int64x64_t::MulByInvert(ns3::int64x64_t const & o) [member function]
cls.add_method('MulByInvert',
'void',
[param('ns3::int64x64_t const &', 'o')])
## int64x64-128.h (module 'core'): ns3::int64x64_t::implementation [variable]
cls.add_static_attribute('implementation', 'ns3::int64x64_t::impl_type const', is_const=True)
return
def register_Ns3Chunk_methods(root_module, cls):
## chunk.h (module 'network'): ns3::Chunk::Chunk() [constructor]
cls.add_constructor([])
## chunk.h (module 'network'): ns3::Chunk::Chunk(ns3::Chunk const & arg0) [constructor]
cls.add_constructor([param('ns3::Chunk const &', 'arg0')])
## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_virtual=True)
## chunk.h (module 'network'): uint32_t ns3::Chunk::Deserialize(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## chunk.h (module 'network'): static ns3::TypeId ns3::Chunk::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## chunk.h (module 'network'): void ns3::Chunk::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3Header_methods(root_module, cls):
cls.add_output_stream_operator()
## header.h (module 'network'): ns3::Header::Header() [constructor]
cls.add_constructor([])
## header.h (module 'network'): ns3::Header::Header(ns3::Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Header const &', 'arg0')])
## header.h (module 'network'): uint32_t ns3::Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_virtual=True)
## header.h (module 'network'): uint32_t ns3::Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## header.h (module 'network'): static ns3::TypeId ns3::Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## header.h (module 'network'): void ns3::Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## header.h (module 'network'): void ns3::Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3Ipv4Header_methods(root_module, cls):
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::Ipv4Header(ns3::Ipv4Header const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Header const &', 'arg0')])
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::Ipv4Header() [constructor]
cls.add_constructor([])
## ipv4-header.h (module 'internet'): uint32_t ns3::Ipv4Header::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## ipv4-header.h (module 'internet'): std::string ns3::Ipv4Header::DscpTypeToString(ns3::Ipv4Header::DscpType dscp) const [member function]
cls.add_method('DscpTypeToString',
'std::string',
[param('ns3::Ipv4Header::DscpType', 'dscp')],
is_const=True)
## ipv4-header.h (module 'internet'): std::string ns3::Ipv4Header::EcnTypeToString(ns3::Ipv4Header::EcnType ecn) const [member function]
cls.add_method('EcnTypeToString',
'std::string',
[param('ns3::Ipv4Header::EcnType', 'ecn')],
is_const=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::EnableChecksum() [member function]
cls.add_method('EnableChecksum',
'void',
[])
## ipv4-header.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Header::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::DscpType ns3::Ipv4Header::GetDscp() const [member function]
cls.add_method('GetDscp',
'ns3::Ipv4Header::DscpType',
[],
is_const=True)
## ipv4-header.h (module 'internet'): ns3::Ipv4Header::EcnType ns3::Ipv4Header::GetEcn() const [member function]
cls.add_method('GetEcn',
'ns3::Ipv4Header::EcnType',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetFragmentOffset() const [member function]
cls.add_method('GetFragmentOffset',
'uint16_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetIdentification() const [member function]
cls.add_method('GetIdentification',
'uint16_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): ns3::TypeId ns3::Ipv4Header::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): uint16_t ns3::Ipv4Header::GetPayloadSize() const [member function]
cls.add_method('GetPayloadSize',
'uint16_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetProtocol() const [member function]
cls.add_method('GetProtocol',
'uint8_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint32_t ns3::Ipv4Header::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Header::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): uint8_t ns3::Ipv4Header::GetTtl() const [member function]
cls.add_method('GetTtl',
'uint8_t',
[],
is_const=True)
## ipv4-header.h (module 'internet'): static ns3::TypeId ns3::Ipv4Header::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsChecksumOk() const [member function]
cls.add_method('IsChecksumOk',
'bool',
[],
is_const=True)
## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsDontFragment() const [member function]
cls.add_method('IsDontFragment',
'bool',
[],
is_const=True)
## ipv4-header.h (module 'internet'): bool ns3::Ipv4Header::IsLastFragment() const [member function]
cls.add_method('IsLastFragment',
'bool',
[],
is_const=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDestination(ns3::Ipv4Address destination) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'destination')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDontFragment() [member function]
cls.add_method('SetDontFragment',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetDscp(ns3::Ipv4Header::DscpType dscp) [member function]
cls.add_method('SetDscp',
'void',
[param('ns3::Ipv4Header::DscpType', 'dscp')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetEcn(ns3::Ipv4Header::EcnType ecn) [member function]
cls.add_method('SetEcn',
'void',
[param('ns3::Ipv4Header::EcnType', 'ecn')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetFragmentOffset(uint16_t offsetBytes) [member function]
cls.add_method('SetFragmentOffset',
'void',
[param('uint16_t', 'offsetBytes')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetIdentification(uint16_t identification) [member function]
cls.add_method('SetIdentification',
'void',
[param('uint16_t', 'identification')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetLastFragment() [member function]
cls.add_method('SetLastFragment',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetMayFragment() [member function]
cls.add_method('SetMayFragment',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetMoreFragments() [member function]
cls.add_method('SetMoreFragments',
'void',
[])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetPayloadSize(uint16_t size) [member function]
cls.add_method('SetPayloadSize',
'void',
[param('uint16_t', 'size')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetProtocol(uint8_t num) [member function]
cls.add_method('SetProtocol',
'void',
[param('uint8_t', 'num')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetSource(ns3::Ipv4Address source) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 'source')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
## ipv4-header.h (module 'internet'): void ns3::Ipv4Header::SetTtl(uint8_t ttl) [member function]
cls.add_method('SetTtl',
'void',
[param('uint8_t', 'ttl')])
return
def register_Ns3Object_methods(root_module, cls):
## object.h (module 'core'): ns3::Object::Object() [constructor]
cls.add_constructor([])
## object.h (module 'core'): void ns3::Object::AggregateObject(ns3::Ptr<ns3::Object> other) [member function]
cls.add_method('AggregateObject',
'void',
[param('ns3::Ptr< ns3::Object >', 'other')])
## object.h (module 'core'): void ns3::Object::Dispose() [member function]
cls.add_method('Dispose',
'void',
[])
## object.h (module 'core'): ns3::Object::AggregateIterator ns3::Object::GetAggregateIterator() const [member function]
cls.add_method('GetAggregateIterator',
'ns3::Object::AggregateIterator',
[],
is_const=True)
## object.h (module 'core'): ns3::TypeId ns3::Object::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## object.h (module 'core'): static ns3::TypeId ns3::Object::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## object.h (module 'core'): void ns3::Object::Initialize() [member function]
cls.add_method('Initialize',
'void',
[])
## object.h (module 'core'): bool ns3::Object::IsInitialized() const [member function]
cls.add_method('IsInitialized',
'bool',
[],
is_const=True)
## object.h (module 'core'): ns3::Object::Object(ns3::Object const & o) [constructor]
cls.add_constructor([param('ns3::Object const &', 'o')],
visibility='protected')
## object.h (module 'core'): void ns3::Object::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## object.h (module 'core'): void ns3::Object::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
## object.h (module 'core'): void ns3::Object::NotifyNewAggregate() [member function]
cls.add_method('NotifyNewAggregate',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3ObjectAggregateIterator_methods(root_module, cls):
## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator(ns3::Object::AggregateIterator const & arg0) [constructor]
cls.add_constructor([param('ns3::Object::AggregateIterator const &', 'arg0')])
## object.h (module 'core'): ns3::Object::AggregateIterator::AggregateIterator() [constructor]
cls.add_constructor([])
## object.h (module 'core'): bool ns3::Object::AggregateIterator::HasNext() const [member function]
cls.add_method('HasNext',
'bool',
[],
is_const=True)
## object.h (module 'core'): ns3::Ptr<const ns3::Object> ns3::Object::AggregateIterator::Next() [member function]
cls.add_method('Next',
'ns3::Ptr< ns3::Object const >',
[])
return
def register_Ns3RandomVariableStream_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::RandomVariableStream::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::RandomVariableStream::RandomVariableStream() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetStream(int64_t stream) [member function]
cls.add_method('SetStream',
'void',
[param('int64_t', 'stream')])
## random-variable-stream.h (module 'core'): int64_t ns3::RandomVariableStream::GetStream() const [member function]
cls.add_method('GetStream',
'int64_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): void ns3::RandomVariableStream::SetAntithetic(bool isAntithetic) [member function]
cls.add_method('SetAntithetic',
'void',
[param('bool', 'isAntithetic')])
## random-variable-stream.h (module 'core'): bool ns3::RandomVariableStream::IsAntithetic() const [member function]
cls.add_method('IsAntithetic',
'bool',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::RandomVariableStream::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_pure_virtual=True, is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::RandomVariableStream::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_pure_virtual=True, is_virtual=True)
## random-variable-stream.h (module 'core'): ns3::RngStream * ns3::RandomVariableStream::Peek() const [member function]
cls.add_method('Peek',
'ns3::RngStream *',
[],
is_const=True, visibility='protected')
return
def register_Ns3SequentialRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::SequentialRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::SequentialRandomVariable::SequentialRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): ns3::Ptr<ns3::RandomVariableStream> ns3::SequentialRandomVariable::GetIncrement() const [member function]
cls.add_method('GetIncrement',
'ns3::Ptr< ns3::RandomVariableStream >',
[],
is_const=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetConsecutive() const [member function]
cls.add_method('GetConsecutive',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::SequentialRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::SequentialRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3SimpleRefCount__Ns3AttributeAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter<ns3::AttributeAccessor> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeAccessor, ns3::empty, ns3::DefaultDeleter< ns3::AttributeAccessor > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3AttributeChecker_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeChecker__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter<ns3::AttributeChecker> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeChecker, ns3::empty, ns3::DefaultDeleter< ns3::AttributeChecker > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3AttributeValue_Ns3Empty_Ns3DefaultDeleter__lt__ns3AttributeValue__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> >::SimpleRefCount(ns3::SimpleRefCount<ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter<ns3::AttributeValue> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::AttributeValue, ns3::empty, ns3::DefaultDeleter< ns3::AttributeValue > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3CallbackImplBase_Ns3Empty_Ns3DefaultDeleter__lt__ns3CallbackImplBase__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> >::SimpleRefCount(ns3::SimpleRefCount<ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter<ns3::CallbackImplBase> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::CallbackImplBase, ns3::empty, ns3::DefaultDeleter< ns3::CallbackImplBase > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >::SimpleRefCount(ns3::SimpleRefCount<ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter< ns3::EventImpl > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter< ns3::Hash::Implementation > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Ipv4MulticastRoute_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4MulticastRoute__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4MulticastRoute> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Ipv4MulticastRoute, ns3::empty, ns3::DefaultDeleter< ns3::Ipv4MulticastRoute > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Ipv4Route_Ns3Empty_Ns3DefaultDeleter__lt__ns3Ipv4Route__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter<ns3::Ipv4Route> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Ipv4Route, ns3::empty, ns3::DefaultDeleter< ns3::Ipv4Route > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3NixVector_Ns3Empty_Ns3DefaultDeleter__lt__ns3NixVector__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> >::SimpleRefCount(ns3::SimpleRefCount<ns3::NixVector, ns3::empty, ns3::DefaultDeleter<ns3::NixVector> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::NixVector, ns3::empty, ns3::DefaultDeleter< ns3::NixVector > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3OutputStreamWrapper_Ns3Empty_Ns3DefaultDeleter__lt__ns3OutputStreamWrapper__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> >::SimpleRefCount(ns3::SimpleRefCount<ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter<ns3::OutputStreamWrapper> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::OutputStreamWrapper, ns3::empty, ns3::DefaultDeleter< ns3::OutputStreamWrapper > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3Packet_Ns3Empty_Ns3DefaultDeleter__lt__ns3Packet__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> >::SimpleRefCount(ns3::SimpleRefCount<ns3::Packet, ns3::empty, ns3::DefaultDeleter<ns3::Packet> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::Packet, ns3::empty, ns3::DefaultDeleter< ns3::Packet > > const &', 'o')])
return
def register_Ns3SimpleRefCount__Ns3TraceSourceAccessor_Ns3Empty_Ns3DefaultDeleter__lt__ns3TraceSourceAccessor__gt___methods(root_module, cls):
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount() [constructor]
cls.add_constructor([])
## simple-ref-count.h (module 'core'): ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> >::SimpleRefCount(ns3::SimpleRefCount<ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter<ns3::TraceSourceAccessor> > const & o) [constructor]
cls.add_constructor([param('ns3::SimpleRefCount< ns3::TraceSourceAccessor, ns3::empty, ns3::DefaultDeleter< ns3::TraceSourceAccessor > > const &', 'o')])
return
def register_Ns3Socket_methods(root_module, cls):
## socket.h (module 'network'): ns3::Socket::Socket(ns3::Socket const & arg0) [constructor]
cls.add_constructor([param('ns3::Socket const &', 'arg0')])
## socket.h (module 'network'): ns3::Socket::Socket() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): int ns3::Socket::Bind(ns3::Address const & address) [member function]
cls.add_method('Bind',
'int',
[param('ns3::Address const &', 'address')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Bind() [member function]
cls.add_method('Bind',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Bind6() [member function]
cls.add_method('Bind6',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::BindToNetDevice(ns3::Ptr<ns3::NetDevice> netdevice) [member function]
cls.add_method('BindToNetDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'netdevice')],
is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Close() [member function]
cls.add_method('Close',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Connect(ns3::Address const & address) [member function]
cls.add_method('Connect',
'int',
[param('ns3::Address const &', 'address')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): static ns3::Ptr<ns3::Socket> ns3::Socket::CreateSocket(ns3::Ptr<ns3::Node> node, ns3::TypeId tid) [member function]
cls.add_method('CreateSocket',
'ns3::Ptr< ns3::Socket >',
[param('ns3::Ptr< ns3::Node >', 'node'), param('ns3::TypeId', 'tid')],
is_static=True)
## socket.h (module 'network'): bool ns3::Socket::GetAllowBroadcast() const [member function]
cls.add_method('GetAllowBroadcast',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Socket::GetBoundNetDevice() [member function]
cls.add_method('GetBoundNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[])
## socket.h (module 'network'): ns3::Socket::SocketErrno ns3::Socket::GetErrno() const [member function]
cls.add_method('GetErrno',
'ns3::Socket::SocketErrno',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTos() const [member function]
cls.add_method('GetIpTos',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpTtl() const [member function]
cls.add_method('GetIpTtl',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6HopLimit() const [member function]
cls.add_method('GetIpv6HopLimit',
'uint8_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetIpv6Tclass() const [member function]
cls.add_method('GetIpv6Tclass',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Node> ns3::Socket::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::GetPeerName(ns3::Address & address) const [member function]
cls.add_method('GetPeerName',
'int',
[param('ns3::Address &', 'address')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::Socket::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint32_t ns3::Socket::GetRxAvailable() const [member function]
cls.add_method('GetRxAvailable',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::GetSockName(ns3::Address & address) const [member function]
cls.add_method('GetSockName',
'int',
[param('ns3::Address &', 'address')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): ns3::Socket::SocketType ns3::Socket::GetSocketType() const [member function]
cls.add_method('GetSocketType',
'ns3::Socket::SocketType',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::Socket::GetTxAvailable() const [member function]
cls.add_method('GetTxAvailable',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::Socket::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): static uint8_t ns3::Socket::IpTos2Priority(uint8_t ipTos) [member function]
cls.add_method('IpTos2Priority',
'uint8_t',
[param('uint8_t', 'ipTos')],
is_static=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6JoinGroup(ns3::Ipv6Address address, ns3::Socket::Ipv6MulticastFilterMode filterMode, std::vector<ns3::Ipv6Address, std::allocator<ns3::Ipv6Address> > sourceAddresses) [member function]
cls.add_method('Ipv6JoinGroup',
'void',
[param('ns3::Ipv6Address', 'address'), param('ns3::Socket::Ipv6MulticastFilterMode', 'filterMode'), param('std::vector< ns3::Ipv6Address >', 'sourceAddresses')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6JoinGroup(ns3::Ipv6Address address) [member function]
cls.add_method('Ipv6JoinGroup',
'void',
[param('ns3::Ipv6Address', 'address')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::Ipv6LeaveGroup() [member function]
cls.add_method('Ipv6LeaveGroup',
'void',
[],
is_virtual=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTos() const [member function]
cls.add_method('IsIpRecvTos',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpRecvTtl() const [member function]
cls.add_method('IsIpRecvTtl',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvHopLimit() const [member function]
cls.add_method('IsIpv6RecvHopLimit',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsIpv6RecvTclass() const [member function]
cls.add_method('IsIpv6RecvTclass',
'bool',
[],
is_const=True)
## socket.h (module 'network'): bool ns3::Socket::IsRecvPktInfo() const [member function]
cls.add_method('IsRecvPktInfo',
'bool',
[],
is_const=True)
## socket.h (module 'network'): int ns3::Socket::Listen() [member function]
cls.add_method('Listen',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv(uint32_t maxSize, uint32_t flags) [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::Recv() [member function]
cls.add_method('Recv',
'ns3::Ptr< ns3::Packet >',
[])
## socket.h (module 'network'): int ns3::Socket::Recv(uint8_t * buf, uint32_t size, uint32_t flags) [member function]
cls.add_method('Recv',
'int',
[param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')])
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(uint32_t maxSize, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'maxSize'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Socket::RecvFrom(ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'ns3::Ptr< ns3::Packet >',
[param('ns3::Address &', 'fromAddress')])
## socket.h (module 'network'): int ns3::Socket::RecvFrom(uint8_t * buf, uint32_t size, uint32_t flags, ns3::Address & fromAddress) [member function]
cls.add_method('RecvFrom',
'int',
[param('uint8_t *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address &', 'fromAddress')])
## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::Send(ns3::Ptr<ns3::Packet> p) [member function]
cls.add_method('Send',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p')])
## socket.h (module 'network'): int ns3::Socket::Send(uint8_t const * buf, uint32_t size, uint32_t flags) [member function]
cls.add_method('Send',
'int',
[param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags')])
## socket.h (module 'network'): int ns3::Socket::SendTo(ns3::Ptr<ns3::Packet> p, uint32_t flags, ns3::Address const & toAddress) [member function]
cls.add_method('SendTo',
'int',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('uint32_t', 'flags'), param('ns3::Address const &', 'toAddress')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::SendTo(uint8_t const * buf, uint32_t size, uint32_t flags, ns3::Address const & address) [member function]
cls.add_method('SendTo',
'int',
[param('uint8_t const *', 'buf'), param('uint32_t', 'size'), param('uint32_t', 'flags'), param('ns3::Address const &', 'address')])
## socket.h (module 'network'): void ns3::Socket::SetAcceptCallback(ns3::Callback<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionRequest, ns3::Callback<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> newConnectionCreated) [member function]
cls.add_method('SetAcceptCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionRequest'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'newConnectionCreated')])
## socket.h (module 'network'): bool ns3::Socket::SetAllowBroadcast(bool allowBroadcast) [member function]
cls.add_method('SetAllowBroadcast',
'bool',
[param('bool', 'allowBroadcast')],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetCloseCallbacks(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> normalClose, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> errorClose) [member function]
cls.add_method('SetCloseCallbacks',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'normalClose'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'errorClose')])
## socket.h (module 'network'): void ns3::Socket::SetConnectCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionSucceeded, ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> connectionFailed) [member function]
cls.add_method('SetConnectCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionSucceeded'), param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'connectionFailed')])
## socket.h (module 'network'): void ns3::Socket::SetDataSentCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> dataSent) [member function]
cls.add_method('SetDataSentCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'dataSent')])
## socket.h (module 'network'): void ns3::Socket::SetIpRecvTos(bool ipv4RecvTos) [member function]
cls.add_method('SetIpRecvTos',
'void',
[param('bool', 'ipv4RecvTos')])
## socket.h (module 'network'): void ns3::Socket::SetIpRecvTtl(bool ipv4RecvTtl) [member function]
cls.add_method('SetIpRecvTtl',
'void',
[param('bool', 'ipv4RecvTtl')])
## socket.h (module 'network'): void ns3::Socket::SetIpTos(uint8_t ipTos) [member function]
cls.add_method('SetIpTos',
'void',
[param('uint8_t', 'ipTos')])
## socket.h (module 'network'): void ns3::Socket::SetIpTtl(uint8_t ipTtl) [member function]
cls.add_method('SetIpTtl',
'void',
[param('uint8_t', 'ipTtl')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetIpv6HopLimit(uint8_t ipHopLimit) [member function]
cls.add_method('SetIpv6HopLimit',
'void',
[param('uint8_t', 'ipHopLimit')],
is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvHopLimit(bool ipv6RecvHopLimit) [member function]
cls.add_method('SetIpv6RecvHopLimit',
'void',
[param('bool', 'ipv6RecvHopLimit')])
## socket.h (module 'network'): void ns3::Socket::SetIpv6RecvTclass(bool ipv6RecvTclass) [member function]
cls.add_method('SetIpv6RecvTclass',
'void',
[param('bool', 'ipv6RecvTclass')])
## socket.h (module 'network'): void ns3::Socket::SetIpv6Tclass(int ipTclass) [member function]
cls.add_method('SetIpv6Tclass',
'void',
[param('int', 'ipTclass')])
## socket.h (module 'network'): void ns3::Socket::SetPriority(uint8_t priority) [member function]
cls.add_method('SetPriority',
'void',
[param('uint8_t', 'priority')])
## socket.h (module 'network'): void ns3::Socket::SetRecvCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> arg0) [member function]
cls.add_method('SetRecvCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'arg0')])
## socket.h (module 'network'): void ns3::Socket::SetRecvPktInfo(bool flag) [member function]
cls.add_method('SetRecvPktInfo',
'void',
[param('bool', 'flag')])
## socket.h (module 'network'): void ns3::Socket::SetSendCallback(ns3::Callback<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> sendCb) [member function]
cls.add_method('SetSendCallback',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'sendCb')])
## socket.h (module 'network'): int ns3::Socket::ShutdownRecv() [member function]
cls.add_method('ShutdownRecv',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): int ns3::Socket::ShutdownSend() [member function]
cls.add_method('ShutdownSend',
'int',
[],
is_pure_virtual=True, is_virtual=True)
## socket.h (module 'network'): void ns3::Socket::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## socket.h (module 'network'): bool ns3::Socket::IsManualIpTtl() const [member function]
cls.add_method('IsManualIpTtl',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6HopLimit() const [member function]
cls.add_method('IsManualIpv6HopLimit',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::IsManualIpv6Tclass() const [member function]
cls.add_method('IsManualIpv6Tclass',
'bool',
[],
is_const=True, visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyConnectionFailed() [member function]
cls.add_method('NotifyConnectionFailed',
'void',
[],
visibility='protected')
## socket.h (module 'network'): bool ns3::Socket::NotifyConnectionRequest(ns3::Address const & from) [member function]
cls.add_method('NotifyConnectionRequest',
'bool',
[param('ns3::Address const &', 'from')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyConnectionSucceeded() [member function]
cls.add_method('NotifyConnectionSucceeded',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyDataRecv() [member function]
cls.add_method('NotifyDataRecv',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyDataSent(uint32_t size) [member function]
cls.add_method('NotifyDataSent',
'void',
[param('uint32_t', 'size')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyErrorClose() [member function]
cls.add_method('NotifyErrorClose',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyNewConnectionCreated(ns3::Ptr<ns3::Socket> socket, ns3::Address const & from) [member function]
cls.add_method('NotifyNewConnectionCreated',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket'), param('ns3::Address const &', 'from')],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifyNormalClose() [member function]
cls.add_method('NotifyNormalClose',
'void',
[],
visibility='protected')
## socket.h (module 'network'): void ns3::Socket::NotifySend(uint32_t spaceAvailable) [member function]
cls.add_method('NotifySend',
'void',
[param('uint32_t', 'spaceAvailable')],
visibility='protected')
return
def register_Ns3SocketIpTosTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag(ns3::SocketIpTosTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpTosTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpTosTag::SocketIpTosTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpTosTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTosTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpTosTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpTosTag::GetTos() const [member function]
cls.add_method('GetTos',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTosTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTosTag::SetTos(uint8_t tos) [member function]
cls.add_method('SetTos',
'void',
[param('uint8_t', 'tos')])
return
def register_Ns3SocketIpTtlTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag(ns3::SocketIpTtlTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpTtlTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpTtlTag::SocketIpTtlTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpTtlTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpTtlTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpTtlTag::GetTtl() const [member function]
cls.add_method('GetTtl',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpTtlTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpTtlTag::SetTtl(uint8_t ttl) [member function]
cls.add_method('SetTtl',
'void',
[param('uint8_t', 'ttl')])
return
def register_Ns3SocketIpv6HopLimitTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag(ns3::SocketIpv6HopLimitTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpv6HopLimitTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpv6HopLimitTag::SocketIpv6HopLimitTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpv6HopLimitTag::GetHopLimit() const [member function]
cls.add_method('GetHopLimit',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6HopLimitTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpv6HopLimitTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6HopLimitTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6HopLimitTag::SetHopLimit(uint8_t hopLimit) [member function]
cls.add_method('SetHopLimit',
'void',
[param('uint8_t', 'hopLimit')])
return
def register_Ns3SocketIpv6TclassTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag(ns3::SocketIpv6TclassTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketIpv6TclassTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketIpv6TclassTag::SocketIpv6TclassTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketIpv6TclassTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketIpv6TclassTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketIpv6TclassTag::GetTclass() const [member function]
cls.add_method('GetTclass',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketIpv6TclassTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketIpv6TclassTag::SetTclass(uint8_t tclass) [member function]
cls.add_method('SetTclass',
'void',
[param('uint8_t', 'tclass')])
return
def register_Ns3SocketPriorityTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketPriorityTag::SocketPriorityTag(ns3::SocketPriorityTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketPriorityTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketPriorityTag::SocketPriorityTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketPriorityTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): ns3::TypeId ns3::SocketPriorityTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint8_t ns3::SocketPriorityTag::GetPriority() const [member function]
cls.add_method('GetPriority',
'uint8_t',
[],
is_const=True)
## socket.h (module 'network'): uint32_t ns3::SocketPriorityTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketPriorityTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketPriorityTag::SetPriority(uint8_t priority) [member function]
cls.add_method('SetPriority',
'void',
[param('uint8_t', 'priority')])
return
def register_Ns3SocketSetDontFragmentTag_methods(root_module, cls):
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag(ns3::SocketSetDontFragmentTag const & arg0) [constructor]
cls.add_constructor([param('ns3::SocketSetDontFragmentTag const &', 'arg0')])
## socket.h (module 'network'): ns3::SocketSetDontFragmentTag::SocketSetDontFragmentTag() [constructor]
cls.add_constructor([])
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Deserialize(ns3::TagBuffer i) [member function]
cls.add_method('Deserialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_virtual=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Disable() [member function]
cls.add_method('Disable',
'void',
[])
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Enable() [member function]
cls.add_method('Enable',
'void',
[])
## socket.h (module 'network'): ns3::TypeId ns3::SocketSetDontFragmentTag::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): uint32_t ns3::SocketSetDontFragmentTag::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## socket.h (module 'network'): static ns3::TypeId ns3::SocketSetDontFragmentTag::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## socket.h (module 'network'): bool ns3::SocketSetDontFragmentTag::IsEnabled() const [member function]
cls.add_method('IsEnabled',
'bool',
[],
is_const=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## socket.h (module 'network'): void ns3::SocketSetDontFragmentTag::Serialize(ns3::TagBuffer i) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::TagBuffer', 'i')],
is_const=True, is_virtual=True)
return
def register_Ns3Time_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_binary_comparison_operator('!=')
cls.add_binary_comparison_operator('<=')
cls.add_binary_comparison_operator('>=')
cls.add_binary_comparison_operator('<')
cls.add_binary_comparison_operator('>')
cls.add_binary_numeric_operator('+', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('-', root_module['ns3::Time'], root_module['ns3::Time'], param('ns3::Time const &', u'right'))
cls.add_binary_numeric_operator('*', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_binary_numeric_operator('/', root_module['ns3::Time'], root_module['ns3::Time'], param('int64_t const &', u'right'))
cls.add_inplace_numeric_operator('+=', param('ns3::Time const &', u'right'))
cls.add_inplace_numeric_operator('-=', param('ns3::Time const &', u'right'))
cls.add_output_stream_operator()
## nstime.h (module 'core'): ns3::Time::Time() [constructor]
cls.add_constructor([])
## nstime.h (module 'core'): ns3::Time::Time(ns3::Time const & o) [constructor]
cls.add_constructor([param('ns3::Time const &', 'o')])
## nstime.h (module 'core'): ns3::Time::Time(double v) [constructor]
cls.add_constructor([param('double', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(int v) [constructor]
cls.add_constructor([param('int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long int v) [constructor]
cls.add_constructor([param('long int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long long int v) [constructor]
cls.add_constructor([param('long long int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(unsigned int v) [constructor]
cls.add_constructor([param('unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long unsigned int v) [constructor]
cls.add_constructor([param('long unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(long long unsigned int v) [constructor]
cls.add_constructor([param('long long unsigned int', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(ns3::int64x64_t const & v) [constructor]
cls.add_constructor([param('ns3::int64x64_t const &', 'v')])
## nstime.h (module 'core'): ns3::Time::Time(std::string const & s) [constructor]
cls.add_constructor([param('std::string const &', 's')])
## nstime.h (module 'core'): ns3::TimeWithUnit ns3::Time::As(ns3::Time::Unit const unit) const [member function]
cls.add_method('As',
'ns3::TimeWithUnit',
[param('ns3::Time::Unit const', 'unit')],
is_const=True)
## nstime.h (module 'core'): int ns3::Time::Compare(ns3::Time const & o) const [member function]
cls.add_method('Compare',
'int',
[param('ns3::Time const &', 'o')],
is_const=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value) [member function]
cls.add_method('From',
'ns3::Time',
[param('ns3::int64x64_t const &', 'value')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::From(ns3::int64x64_t const & value, ns3::Time::Unit unit) [member function]
cls.add_method('From',
'ns3::Time',
[param('ns3::int64x64_t const &', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromDouble(double value, ns3::Time::Unit unit) [member function]
cls.add_method('FromDouble',
'ns3::Time',
[param('double', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::FromInteger(uint64_t value, ns3::Time::Unit unit) [member function]
cls.add_method('FromInteger',
'ns3::Time',
[param('uint64_t', 'value'), param('ns3::Time::Unit', 'unit')],
is_static=True)
## nstime.h (module 'core'): double ns3::Time::GetDays() const [member function]
cls.add_method('GetDays',
'double',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetDouble() const [member function]
cls.add_method('GetDouble',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetFemtoSeconds() const [member function]
cls.add_method('GetFemtoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetHours() const [member function]
cls.add_method('GetHours',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetInteger() const [member function]
cls.add_method('GetInteger',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetMicroSeconds() const [member function]
cls.add_method('GetMicroSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetMilliSeconds() const [member function]
cls.add_method('GetMilliSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetMinutes() const [member function]
cls.add_method('GetMinutes',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetNanoSeconds() const [member function]
cls.add_method('GetNanoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetPicoSeconds() const [member function]
cls.add_method('GetPicoSeconds',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): static ns3::Time::Unit ns3::Time::GetResolution() [member function]
cls.add_method('GetResolution',
'ns3::Time::Unit',
[],
is_static=True)
## nstime.h (module 'core'): double ns3::Time::GetSeconds() const [member function]
cls.add_method('GetSeconds',
'double',
[],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::GetTimeStep() const [member function]
cls.add_method('GetTimeStep',
'int64_t',
[],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::GetYears() const [member function]
cls.add_method('GetYears',
'double',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsNegative() const [member function]
cls.add_method('IsNegative',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsPositive() const [member function]
cls.add_method('IsPositive',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsStrictlyNegative() const [member function]
cls.add_method('IsStrictlyNegative',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsStrictlyPositive() const [member function]
cls.add_method('IsStrictlyPositive',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): bool ns3::Time::IsZero() const [member function]
cls.add_method('IsZero',
'bool',
[],
is_const=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::Max() [member function]
cls.add_method('Max',
'ns3::Time',
[],
is_static=True)
## nstime.h (module 'core'): static ns3::Time ns3::Time::Min() [member function]
cls.add_method('Min',
'ns3::Time',
[],
is_static=True)
## nstime.h (module 'core'): static void ns3::Time::SetResolution(ns3::Time::Unit resolution) [member function]
cls.add_method('SetResolution',
'void',
[param('ns3::Time::Unit', 'resolution')],
is_static=True)
## nstime.h (module 'core'): static bool ns3::Time::StaticInit() [member function]
cls.add_method('StaticInit',
'bool',
[],
is_static=True)
## nstime.h (module 'core'): ns3::int64x64_t ns3::Time::To(ns3::Time::Unit unit) const [member function]
cls.add_method('To',
'ns3::int64x64_t',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): double ns3::Time::ToDouble(ns3::Time::Unit unit) const [member function]
cls.add_method('ToDouble',
'double',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
## nstime.h (module 'core'): int64_t ns3::Time::ToInteger(ns3::Time::Unit unit) const [member function]
cls.add_method('ToInteger',
'int64_t',
[param('ns3::Time::Unit', 'unit')],
is_const=True)
return
def register_Ns3TraceSourceAccessor_methods(root_module, cls):
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor(ns3::TraceSourceAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::TraceSourceAccessor const &', 'arg0')])
## trace-source-accessor.h (module 'core'): ns3::TraceSourceAccessor::TraceSourceAccessor() [constructor]
cls.add_constructor([])
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Connect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]
cls.add_method('Connect',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::ConnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]
cls.add_method('ConnectWithoutContext',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::Disconnect(ns3::ObjectBase * obj, std::string context, ns3::CallbackBase const & cb) const [member function]
cls.add_method('Disconnect',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('std::string', 'context'), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trace-source-accessor.h (module 'core'): bool ns3::TraceSourceAccessor::DisconnectWithoutContext(ns3::ObjectBase * obj, ns3::CallbackBase const & cb) const [member function]
cls.add_method('DisconnectWithoutContext',
'bool',
[param('ns3::ObjectBase *', 'obj', transfer_ownership=False), param('ns3::CallbackBase const &', 'cb')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3Trailer_methods(root_module, cls):
cls.add_output_stream_operator()
## trailer.h (module 'network'): ns3::Trailer::Trailer() [constructor]
cls.add_constructor([])
## trailer.h (module 'network'): ns3::Trailer::Trailer(ns3::Trailer const & arg0) [constructor]
cls.add_constructor([param('ns3::Trailer const &', 'arg0')])
## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'end')],
is_pure_virtual=True, is_virtual=True)
## trailer.h (module 'network'): uint32_t ns3::Trailer::Deserialize(ns3::Buffer::Iterator start, ns3::Buffer::Iterator end) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('ns3::Buffer::Iterator', 'end')],
is_virtual=True)
## trailer.h (module 'network'): uint32_t ns3::Trailer::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trailer.h (module 'network'): static ns3::TypeId ns3::Trailer::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## trailer.h (module 'network'): void ns3::Trailer::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## trailer.h (module 'network'): void ns3::Trailer::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3TriangularRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::TriangularRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::TriangularRandomVariable::TriangularRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue(double mean, double min, double max) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'min'), param('double', 'max')])
## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger(uint32_t mean, uint32_t min, uint32_t max) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'min'), param('uint32_t', 'max')])
## random-variable-stream.h (module 'core'): double ns3::TriangularRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::TriangularRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3UniformRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::UniformRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::UniformRandomVariable::UniformRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMin() const [member function]
cls.add_method('GetMin',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetMax() const [member function]
cls.add_method('GetMax',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue(double min, double max) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'min'), param('double', 'max')])
## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger(uint32_t min, uint32_t max) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'min'), param('uint32_t', 'max')])
## random-variable-stream.h (module 'core'): double ns3::UniformRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::UniformRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3WeibullRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::WeibullRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::WeibullRandomVariable::WeibullRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetScale() const [member function]
cls.add_method('GetScale',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetShape() const [member function]
cls.add_method('GetShape',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue(double scale, double shape, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'scale'), param('double', 'shape'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::WeibullRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::WeibullRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ZetaRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZetaRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ZetaRandomVariable::ZetaRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue(double alpha) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'alpha')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger(uint32_t alpha) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'alpha')])
## random-variable-stream.h (module 'core'): double ns3::ZetaRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ZetaRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ZipfRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ZipfRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ZipfRandomVariable::ZipfRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetN() const [member function]
cls.add_method('GetN',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue(uint32_t n, double alpha) [member function]
cls.add_method('GetValue',
'double',
[param('uint32_t', 'n'), param('double', 'alpha')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger(uint32_t n, uint32_t alpha) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'n'), param('uint32_t', 'alpha')])
## random-variable-stream.h (module 'core'): double ns3::ZipfRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ZipfRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3AttributeAccessor_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor(ns3::AttributeAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeAccessor const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeAccessor::AttributeAccessor() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::AttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function]
cls.add_method('Get',
'bool',
[param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasGetter() const [member function]
cls.add_method('HasGetter',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::HasSetter() const [member function]
cls.add_method('HasSetter',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]
cls.add_method('Set',
'bool',
[param('ns3::ObjectBase *', 'object', transfer_ownership=False), param('ns3::AttributeValue const &', 'value')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3AttributeChecker_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker(ns3::AttributeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeChecker const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeChecker::AttributeChecker() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::AttributeChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeChecker::CreateValidValue(ns3::AttributeValue const & value) const [member function]
cls.add_method('CreateValidValue',
'ns3::Ptr< ns3::AttributeValue >',
[param('ns3::AttributeValue const &', 'value')],
is_const=True)
## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::AttributeChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3AttributeValue_methods(root_module, cls):
## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue(ns3::AttributeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::AttributeValue const &', 'arg0')])
## attribute.h (module 'core'): ns3::AttributeValue::AttributeValue() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::AttributeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::AttributeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_pure_virtual=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::AttributeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3CallbackChecker_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackChecker::CallbackChecker(ns3::CallbackChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackChecker const &', 'arg0')])
return
def register_Ns3CallbackImplBase_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImplBase::CallbackImplBase(ns3::CallbackImplBase const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImplBase const &', 'arg0')])
## callback.h (module 'core'): std::string ns3::CallbackImplBase::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImplBase::IsEqual(ns3::Ptr<const ns3::CallbackImplBase> other) const [member function]
cls.add_method('IsEqual',
'bool',
[param('ns3::Ptr< ns3::CallbackImplBase const >', 'other')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::Demangle(std::string const & mangled) [member function]
cls.add_method('Demangle',
'std::string',
[param('std::string const &', 'mangled')],
is_static=True, visibility='protected')
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::ObjectBase*'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'void'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::NetDevice> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::Packet const> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'unsigned short'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Address const&'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::NetDevice::PacketType'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::Ptr<ns3::Socket> '])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'bool'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'unsigned int'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'ns3::olsr::PacketHeader const&'])
## callback.h (module 'core'): static std::string ns3::CallbackImplBase::GetCppTypeid() [member function]
cls.add_method('GetCppTypeid',
'std::string',
[],
is_static=True, visibility='protected', template_parameters=[u'std::vector<ns3::olsr::MessageHeader', u' std::allocator<ns3::olsr::MessageHeader> > const&'])
return
def register_Ns3CallbackValue_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackValue const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackValue const &', 'arg0')])
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackValue::CallbackValue(ns3::CallbackBase const & base) [constructor]
cls.add_constructor([param('ns3::CallbackBase const &', 'base')])
## callback.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::CallbackValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## callback.h (module 'core'): std::string ns3::CallbackValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackValue::Set(ns3::CallbackBase base) [member function]
cls.add_method('Set',
'void',
[param('ns3::CallbackBase', 'base')])
return
def register_Ns3ConstantRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ConstantRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ConstantRandomVariable::ConstantRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetConstant() const [member function]
cls.add_method('GetConstant',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue(double constant) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'constant')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger(uint32_t constant) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'constant')])
## random-variable-stream.h (module 'core'): double ns3::ConstantRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ConstantRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3DeterministicRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::DeterministicRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::DeterministicRandomVariable::DeterministicRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::DeterministicRandomVariable::SetValueArray(double * values, std::size_t length) [member function]
cls.add_method('SetValueArray',
'void',
[param('double *', 'values'), param('std::size_t', 'length')])
## random-variable-stream.h (module 'core'): double ns3::DeterministicRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::DeterministicRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3EmpiricalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): ns3::EmpiricalRandomVariable::EmpiricalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::CDF(double v, double c) [member function]
cls.add_method('CDF',
'void',
[param('double', 'v'), param('double', 'c')])
## random-variable-stream.h (module 'core'): uint32_t ns3::EmpiricalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::EmpiricalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): double ns3::EmpiricalRandomVariable::Interpolate(double c1, double c2, double v1, double v2, double r) [member function]
cls.add_method('Interpolate',
'double',
[param('double', 'c1'), param('double', 'c2'), param('double', 'v1'), param('double', 'v2'), param('double', 'r')],
visibility='private', is_virtual=True)
## random-variable-stream.h (module 'core'): void ns3::EmpiricalRandomVariable::Validate() [member function]
cls.add_method('Validate',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3EmptyAttributeAccessor_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor::EmptyAttributeAccessor(ns3::EmptyAttributeAccessor const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeAccessor const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeAccessor::EmptyAttributeAccessor() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::Get(ns3::ObjectBase const * object, ns3::AttributeValue & attribute) const [member function]
cls.add_method('Get',
'bool',
[param('ns3::ObjectBase const *', 'object'), param('ns3::AttributeValue &', 'attribute')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::HasGetter() const [member function]
cls.add_method('HasGetter',
'bool',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::HasSetter() const [member function]
cls.add_method('HasSetter',
'bool',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeAccessor::Set(ns3::ObjectBase * object, ns3::AttributeValue const & value) const [member function]
cls.add_method('Set',
'bool',
[param('ns3::ObjectBase *', 'object'), param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
return
def register_Ns3EmptyAttributeChecker_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeChecker::EmptyAttributeChecker(ns3::EmptyAttributeChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeChecker const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeChecker::EmptyAttributeChecker() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::Check(ns3::AttributeValue const & value) const [member function]
cls.add_method('Check',
'bool',
[param('ns3::AttributeValue const &', 'value')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::Copy(ns3::AttributeValue const & source, ns3::AttributeValue & destination) const [member function]
cls.add_method('Copy',
'bool',
[param('ns3::AttributeValue const &', 'source'), param('ns3::AttributeValue &', 'destination')],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeChecker::Create() const [member function]
cls.add_method('Create',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeChecker::GetUnderlyingTypeInformation() const [member function]
cls.add_method('GetUnderlyingTypeInformation',
'std::string',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeChecker::GetValueTypeName() const [member function]
cls.add_method('GetValueTypeName',
'std::string',
[],
is_const=True, is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeChecker::HasUnderlyingTypeInformation() const [member function]
cls.add_method('HasUnderlyingTypeInformation',
'bool',
[],
is_const=True, is_virtual=True)
return
def register_Ns3EmptyAttributeValue_methods(root_module, cls):
## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue(ns3::EmptyAttributeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::EmptyAttributeValue const &', 'arg0')])
## attribute.h (module 'core'): ns3::EmptyAttributeValue::EmptyAttributeValue() [constructor]
cls.add_constructor([])
## attribute.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::EmptyAttributeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, visibility='private', is_virtual=True)
## attribute.h (module 'core'): bool ns3::EmptyAttributeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
visibility='private', is_virtual=True)
## attribute.h (module 'core'): std::string ns3::EmptyAttributeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, visibility='private', is_virtual=True)
return
def register_Ns3ErlangRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ErlangRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ErlangRandomVariable::ErlangRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetK() const [member function]
cls.add_method('GetK',
'uint32_t',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetLambda() const [member function]
cls.add_method('GetLambda',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue(uint32_t k, double lambda) [member function]
cls.add_method('GetValue',
'double',
[param('uint32_t', 'k'), param('double', 'lambda')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger(uint32_t k, uint32_t lambda) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'k'), param('uint32_t', 'lambda')])
## random-variable-stream.h (module 'core'): double ns3::ErlangRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ErlangRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3EventImpl_methods(root_module, cls):
## event-impl.h (module 'core'): ns3::EventImpl::EventImpl(ns3::EventImpl const & arg0) [constructor]
cls.add_constructor([param('ns3::EventImpl const &', 'arg0')])
## event-impl.h (module 'core'): ns3::EventImpl::EventImpl() [constructor]
cls.add_constructor([])
## event-impl.h (module 'core'): void ns3::EventImpl::Cancel() [member function]
cls.add_method('Cancel',
'void',
[])
## event-impl.h (module 'core'): void ns3::EventImpl::Invoke() [member function]
cls.add_method('Invoke',
'void',
[])
## event-impl.h (module 'core'): bool ns3::EventImpl::IsCancelled() [member function]
cls.add_method('IsCancelled',
'bool',
[])
## event-impl.h (module 'core'): void ns3::EventImpl::Notify() [member function]
cls.add_method('Notify',
'void',
[],
is_pure_virtual=True, visibility='protected', is_virtual=True)
return
def register_Ns3ExponentialRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ExponentialRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ExponentialRandomVariable::ExponentialRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue(double mean, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger(uint32_t mean, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::ExponentialRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ExponentialRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3GammaRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::GammaRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::GammaRandomVariable::GammaRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetAlpha() const [member function]
cls.add_method('GetAlpha',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetBeta() const [member function]
cls.add_method('GetBeta',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue(double alpha, double beta) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'alpha'), param('double', 'beta')])
## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger(uint32_t alpha, uint32_t beta) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'alpha'), param('uint32_t', 'beta')])
## random-variable-stream.h (module 'core'): double ns3::GammaRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::GammaRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3Ipv4_methods(root_module, cls):
## ipv4.h (module 'internet'): ns3::Ipv4::Ipv4(ns3::Ipv4 const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4 const &', 'arg0')])
## ipv4.h (module 'internet'): ns3::Ipv4::Ipv4() [constructor]
cls.add_constructor([])
## ipv4.h (module 'internet'): bool ns3::Ipv4::AddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('AddAddress',
'bool',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::AddInterface(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddInterface',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::Socket> ns3::Ipv4::CreateRawSocket() [member function]
cls.add_method('CreateRawSocket',
'ns3::Ptr< ns3::Socket >',
[],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::DeleteRawSocket(ns3::Ptr<ns3::Socket> socket) [member function]
cls.add_method('DeleteRawSocket',
'void',
[param('ns3::Ptr< ns3::Socket >', 'socket')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4InterfaceAddress ns3::Ipv4::GetAddress(uint32_t interface, uint32_t addressIndex) const [member function]
cls.add_method('GetAddress',
'ns3::Ipv4InterfaceAddress',
[param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForAddress(ns3::Ipv4Address address) const [member function]
cls.add_method('GetInterfaceForAddress',
'int32_t',
[param('ns3::Ipv4Address', 'address')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForDevice(ns3::Ptr<const ns3::NetDevice> device) const [member function]
cls.add_method('GetInterfaceForDevice',
'int32_t',
[param('ns3::Ptr< ns3::NetDevice const >', 'device')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): int32_t ns3::Ipv4::GetInterfaceForPrefix(ns3::Ipv4Address address, ns3::Ipv4Mask mask) const [member function]
cls.add_method('GetInterfaceForPrefix',
'int32_t',
[param('ns3::Ipv4Address', 'address'), param('ns3::Ipv4Mask', 'mask')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): uint16_t ns3::Ipv4::GetMetric(uint32_t interface) const [member function]
cls.add_method('GetMetric',
'uint16_t',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): uint16_t ns3::Ipv4::GetMtu(uint32_t interface) const [member function]
cls.add_method('GetMtu',
'uint16_t',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::GetNAddresses(uint32_t interface) const [member function]
cls.add_method('GetNAddresses',
'uint32_t',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): uint32_t ns3::Ipv4::GetNInterfaces() const [member function]
cls.add_method('GetNInterfaces',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4::GetNetDevice(uint32_t interface) [member function]
cls.add_method('GetNetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4::GetProtocol(int protocolNumber) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::IpL4Protocol >',
[param('int', 'protocolNumber')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::IpL4Protocol> ns3::Ipv4::GetProtocol(int protocolNumber, int32_t interfaceIndex) const [member function]
cls.add_method('GetProtocol',
'ns3::Ptr< ns3::IpL4Protocol >',
[param('int', 'protocolNumber'), param('int32_t', 'interfaceIndex')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4::GetRoutingProtocol() const [member function]
cls.add_method('GetRoutingProtocol',
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): static ns3::TypeId ns3::Ipv4::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Insert(ns3::Ptr<ns3::IpL4Protocol> protocol, uint32_t interfaceIndex) [member function]
cls.add_method('Insert',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol'), param('uint32_t', 'interfaceIndex')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::IsDestinationAddress(ns3::Ipv4Address address, uint32_t iif) const [member function]
cls.add_method('IsDestinationAddress',
'bool',
[param('ns3::Ipv4Address', 'address'), param('uint32_t', 'iif')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::IsForwarding(uint32_t interface) const [member function]
cls.add_method('IsForwarding',
'bool',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::IsUp(uint32_t interface) const [member function]
cls.add_method('IsUp',
'bool',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Remove(ns3::Ptr<ns3::IpL4Protocol> protocol, uint32_t interfaceIndex) [member function]
cls.add_method('Remove',
'void',
[param('ns3::Ptr< ns3::IpL4Protocol >', 'protocol'), param('uint32_t', 'interfaceIndex')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::RemoveAddress(uint32_t interface, uint32_t addressIndex) [member function]
cls.add_method('RemoveAddress',
'bool',
[param('uint32_t', 'interface'), param('uint32_t', 'addressIndex')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::RemoveAddress(uint32_t interface, ns3::Ipv4Address address) [member function]
cls.add_method('RemoveAddress',
'bool',
[param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SelectSourceAddress(ns3::Ptr<const ns3::NetDevice> device, ns3::Ipv4Address dst, ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e scope) [member function]
cls.add_method('SelectSourceAddress',
'ns3::Ipv4Address',
[param('ns3::Ptr< ns3::NetDevice const >', 'device'), param('ns3::Ipv4Address', 'dst'), param('ns3::Ipv4InterfaceAddress::InterfaceAddressScope_e', 'scope')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::Send(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Address source, ns3::Ipv4Address destination, uint8_t protocol, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('Send',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Address', 'source'), param('ns3::Ipv4Address', 'destination'), param('uint8_t', 'protocol'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SendWithHeader(ns3::Ptr<ns3::Packet> packet, ns3::Ipv4Header ipHeader, ns3::Ptr<ns3::Ipv4Route> route) [member function]
cls.add_method('SendWithHeader',
'void',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Ipv4Header', 'ipHeader'), param('ns3::Ptr< ns3::Ipv4Route >', 'route')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetDown(uint32_t interface) [member function]
cls.add_method('SetDown',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetForwarding(uint32_t interface, bool val) [member function]
cls.add_method('SetForwarding',
'void',
[param('uint32_t', 'interface'), param('bool', 'val')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetMetric(uint32_t interface, uint16_t metric) [member function]
cls.add_method('SetMetric',
'void',
[param('uint32_t', 'interface'), param('uint16_t', 'metric')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol) [member function]
cls.add_method('SetRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetUp(uint32_t interface) [member function]
cls.add_method('SetUp',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4::SourceAddressSelection(uint32_t interface, ns3::Ipv4Address dest) [member function]
cls.add_method('SourceAddressSelection',
'ns3::Ipv4Address',
[param('uint32_t', 'interface'), param('ns3::Ipv4Address', 'dest')],
is_pure_virtual=True, is_virtual=True)
## ipv4.h (module 'internet'): ns3::Ipv4::IF_ANY [variable]
cls.add_static_attribute('IF_ANY', 'uint32_t const', is_const=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::GetIpForward() const [member function]
cls.add_method('GetIpForward',
'bool',
[],
is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
## ipv4.h (module 'internet'): bool ns3::Ipv4::GetWeakEsModel() const [member function]
cls.add_method('GetWeakEsModel',
'bool',
[],
is_pure_virtual=True, is_const=True, visibility='private', is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetIpForward(bool forward) [member function]
cls.add_method('SetIpForward',
'void',
[param('bool', 'forward')],
is_pure_virtual=True, visibility='private', is_virtual=True)
## ipv4.h (module 'internet'): void ns3::Ipv4::SetWeakEsModel(bool model) [member function]
cls.add_method('SetWeakEsModel',
'void',
[param('bool', 'model')],
is_pure_virtual=True, visibility='private', is_virtual=True)
return
def register_Ns3Ipv4AddressChecker_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressChecker::Ipv4AddressChecker(ns3::Ipv4AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressChecker const &', 'arg0')])
return
def register_Ns3Ipv4AddressValue_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4Address const & value) [constructor]
cls.add_constructor([param('ns3::Ipv4Address const &', 'value')])
## ipv4-address.h (module 'network'): ns3::Ipv4AddressValue::Ipv4AddressValue(ns3::Ipv4AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4AddressValue const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Address ns3::Ipv4AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-address.h (module 'network'): std::string ns3::Ipv4AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4AddressValue::Set(ns3::Ipv4Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv4Address const &', 'value')])
return
def register_Ns3Ipv4MaskChecker_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskChecker::Ipv4MaskChecker(ns3::Ipv4MaskChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MaskChecker const &', 'arg0')])
return
def register_Ns3Ipv4MaskValue_methods(root_module, cls):
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue() [constructor]
cls.add_constructor([])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4Mask const & value) [constructor]
cls.add_constructor([param('ns3::Ipv4Mask const &', 'value')])
## ipv4-address.h (module 'network'): ns3::Ipv4MaskValue::Ipv4MaskValue(ns3::Ipv4MaskValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MaskValue const &', 'arg0')])
## ipv4-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv4MaskValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): bool ns3::Ipv4MaskValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv4-address.h (module 'network'): ns3::Ipv4Mask ns3::Ipv4MaskValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv4Mask',
[],
is_const=True)
## ipv4-address.h (module 'network'): std::string ns3::Ipv4MaskValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv4-address.h (module 'network'): void ns3::Ipv4MaskValue::Set(ns3::Ipv4Mask const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv4Mask const &', 'value')])
return
def register_Ns3Ipv4MulticastRoute_methods(root_module, cls):
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::Ipv4MulticastRoute(ns3::Ipv4MulticastRoute const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4MulticastRoute const &', 'arg0')])
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::Ipv4MulticastRoute() [constructor]
cls.add_constructor([])
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetGroup() const [member function]
cls.add_method('GetGroup',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4MulticastRoute::GetOrigin() const [member function]
cls.add_method('GetOrigin',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): std::map<unsigned int, unsigned int, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > > ns3::Ipv4MulticastRoute::GetOutputTtlMap() const [member function]
cls.add_method('GetOutputTtlMap',
'std::map< unsigned int, unsigned int >',
[],
is_const=True)
## ipv4-route.h (module 'internet'): uint32_t ns3::Ipv4MulticastRoute::GetParent() const [member function]
cls.add_method('GetParent',
'uint32_t',
[],
is_const=True)
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetGroup(ns3::Ipv4Address const group) [member function]
cls.add_method('SetGroup',
'void',
[param('ns3::Ipv4Address const', 'group')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetOrigin(ns3::Ipv4Address const origin) [member function]
cls.add_method('SetOrigin',
'void',
[param('ns3::Ipv4Address const', 'origin')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetOutputTtl(uint32_t oif, uint32_t ttl) [member function]
cls.add_method('SetOutputTtl',
'void',
[param('uint32_t', 'oif'), param('uint32_t', 'ttl')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4MulticastRoute::SetParent(uint32_t iif) [member function]
cls.add_method('SetParent',
'void',
[param('uint32_t', 'iif')])
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::MAX_INTERFACES [variable]
cls.add_static_attribute('MAX_INTERFACES', 'uint32_t const', is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4MulticastRoute::MAX_TTL [variable]
cls.add_static_attribute('MAX_TTL', 'uint32_t const', is_const=True)
return
def register_Ns3Ipv4Route_methods(root_module, cls):
cls.add_output_stream_operator()
## ipv4-route.h (module 'internet'): ns3::Ipv4Route::Ipv4Route(ns3::Ipv4Route const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4Route const &', 'arg0')])
## ipv4-route.h (module 'internet'): ns3::Ipv4Route::Ipv4Route() [constructor]
cls.add_constructor([])
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetDestination() const [member function]
cls.add_method('GetDestination',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetGateway() const [member function]
cls.add_method('GetGateway',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ptr<ns3::NetDevice> ns3::Ipv4Route::GetOutputDevice() const [member function]
cls.add_method('GetOutputDevice',
'ns3::Ptr< ns3::NetDevice >',
[],
is_const=True)
## ipv4-route.h (module 'internet'): ns3::Ipv4Address ns3::Ipv4Route::GetSource() const [member function]
cls.add_method('GetSource',
'ns3::Ipv4Address',
[],
is_const=True)
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetDestination(ns3::Ipv4Address dest) [member function]
cls.add_method('SetDestination',
'void',
[param('ns3::Ipv4Address', 'dest')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetGateway(ns3::Ipv4Address gw) [member function]
cls.add_method('SetGateway',
'void',
[param('ns3::Ipv4Address', 'gw')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetOutputDevice(ns3::Ptr<ns3::NetDevice> outputDevice) [member function]
cls.add_method('SetOutputDevice',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'outputDevice')])
## ipv4-route.h (module 'internet'): void ns3::Ipv4Route::SetSource(ns3::Ipv4Address src) [member function]
cls.add_method('SetSource',
'void',
[param('ns3::Ipv4Address', 'src')])
return
def register_Ns3Ipv4RoutingProtocol_methods(root_module, cls):
## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol() [constructor]
cls.add_constructor([])
## ipv4-routing-protocol.h (module 'internet'): ns3::Ipv4RoutingProtocol::Ipv4RoutingProtocol(ns3::Ipv4RoutingProtocol const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4RoutingProtocol const &', 'arg0')])
## ipv4-routing-protocol.h (module 'internet'): static ns3::TypeId ns3::Ipv4RoutingProtocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyAddAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceDown',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceUp',
'void',
[param('uint32_t', 'interface')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyRemoveAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): bool ns3::Ipv4RoutingProtocol::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Ipv4RoutingProtocol::UnicastForwardCallback ucb, ns3::Ipv4RoutingProtocol::MulticastForwardCallback mcb, ns3::Ipv4RoutingProtocol::LocalDeliverCallback lcb, ns3::Ipv4RoutingProtocol::ErrorCallback ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4RoutingProtocol::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_pure_virtual=True, is_virtual=True)
## ipv4-routing-protocol.h (module 'internet'): void ns3::Ipv4RoutingProtocol::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3Ipv4StaticRouting_methods(root_module, cls):
## ipv4-static-routing.h (module 'internet'): ns3::Ipv4StaticRouting::Ipv4StaticRouting(ns3::Ipv4StaticRouting const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4StaticRouting const &', 'arg0')])
## ipv4-static-routing.h (module 'internet'): ns3::Ipv4StaticRouting::Ipv4StaticRouting() [constructor]
cls.add_constructor([])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::AddHostRouteTo(ns3::Ipv4Address dest, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddHostRouteTo',
'void',
[param('ns3::Ipv4Address', 'dest'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::AddMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface, std::vector<unsigned int, std::allocator<unsigned int> > outputInterfaces) [member function]
cls.add_method('AddMulticastRoute',
'void',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface'), param('std::vector< unsigned int >', 'outputInterfaces')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::AddNetworkRouteTo(ns3::Ipv4Address network, ns3::Ipv4Mask networkMask, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('AddNetworkRouteTo',
'void',
[param('ns3::Ipv4Address', 'network'), param('ns3::Ipv4Mask', 'networkMask'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')])
## ipv4-static-routing.h (module 'internet'): ns3::Ipv4RoutingTableEntry ns3::Ipv4StaticRouting::GetDefaultRoute() [member function]
cls.add_method('GetDefaultRoute',
'ns3::Ipv4RoutingTableEntry',
[])
## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetMetric(uint32_t index) const [member function]
cls.add_method('GetMetric',
'uint32_t',
[param('uint32_t', 'index')],
is_const=True)
## ipv4-static-routing.h (module 'internet'): ns3::Ipv4MulticastRoutingTableEntry ns3::Ipv4StaticRouting::GetMulticastRoute(uint32_t i) const [member function]
cls.add_method('GetMulticastRoute',
'ns3::Ipv4MulticastRoutingTableEntry',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetNMulticastRoutes() const [member function]
cls.add_method('GetNMulticastRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-static-routing.h (module 'internet'): uint32_t ns3::Ipv4StaticRouting::GetNRoutes() const [member function]
cls.add_method('GetNRoutes',
'uint32_t',
[],
is_const=True)
## ipv4-static-routing.h (module 'internet'): ns3::Ipv4RoutingTableEntry ns3::Ipv4StaticRouting::GetRoute(uint32_t i) const [member function]
cls.add_method('GetRoute',
'ns3::Ipv4RoutingTableEntry',
[param('uint32_t', 'i')],
is_const=True)
## ipv4-static-routing.h (module 'internet'): static ns3::TypeId ns3::Ipv4StaticRouting::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyAddAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::NotifyInterfaceDown(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceDown',
'void',
[param('uint32_t', 'interface')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::NotifyInterfaceUp(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceUp',
'void',
[param('uint32_t', 'interface')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyRemoveAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_const=True, is_virtual=True)
## ipv4-static-routing.h (module 'internet'): bool ns3::Ipv4StaticRouting::RemoveMulticastRoute(ns3::Ipv4Address origin, ns3::Ipv4Address group, uint32_t inputInterface) [member function]
cls.add_method('RemoveMulticastRoute',
'bool',
[param('ns3::Ipv4Address', 'origin'), param('ns3::Ipv4Address', 'group'), param('uint32_t', 'inputInterface')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::RemoveMulticastRoute(uint32_t index) [member function]
cls.add_method('RemoveMulticastRoute',
'void',
[param('uint32_t', 'index')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::RemoveRoute(uint32_t i) [member function]
cls.add_method('RemoveRoute',
'void',
[param('uint32_t', 'i')])
## ipv4-static-routing.h (module 'internet'): bool ns3::Ipv4StaticRouting::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Ipv4RoutingProtocol::UnicastForwardCallback ucb, ns3::Ipv4RoutingProtocol::MulticastForwardCallback mcb, ns3::Ipv4RoutingProtocol::LocalDeliverCallback lcb, ns3::Ipv4RoutingProtocol::ErrorCallback ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4StaticRouting::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::SetDefaultMulticastRoute(uint32_t outputInterface) [member function]
cls.add_method('SetDefaultMulticastRoute',
'void',
[param('uint32_t', 'outputInterface')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::SetDefaultRoute(ns3::Ipv4Address nextHop, uint32_t interface, uint32_t metric=0) [member function]
cls.add_method('SetDefaultRoute',
'void',
[param('ns3::Ipv4Address', 'nextHop'), param('uint32_t', 'interface'), param('uint32_t', 'metric', default_value='0')])
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
is_virtual=True)
## ipv4-static-routing.h (module 'internet'): void ns3::Ipv4StaticRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3Ipv6AddressChecker_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressChecker::Ipv6AddressChecker(ns3::Ipv6AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressChecker const &', 'arg0')])
return
def register_Ns3Ipv6AddressValue_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6Address const & value) [constructor]
cls.add_constructor([param('ns3::Ipv6Address const &', 'value')])
## ipv6-address.h (module 'network'): ns3::Ipv6AddressValue::Ipv6AddressValue(ns3::Ipv6AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6AddressValue const &', 'arg0')])
## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv6-address.h (module 'network'): ns3::Ipv6Address ns3::Ipv6AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv6Address',
[],
is_const=True)
## ipv6-address.h (module 'network'): std::string ns3::Ipv6AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6AddressValue::Set(ns3::Ipv6Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv6Address const &', 'value')])
return
def register_Ns3Ipv6PrefixChecker_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixChecker::Ipv6PrefixChecker(ns3::Ipv6PrefixChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6PrefixChecker const &', 'arg0')])
return
def register_Ns3Ipv6PrefixValue_methods(root_module, cls):
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue() [constructor]
cls.add_constructor([])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6Prefix const & value) [constructor]
cls.add_constructor([param('ns3::Ipv6Prefix const &', 'value')])
## ipv6-address.h (module 'network'): ns3::Ipv6PrefixValue::Ipv6PrefixValue(ns3::Ipv6PrefixValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv6PrefixValue const &', 'arg0')])
## ipv6-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Ipv6PrefixValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): bool ns3::Ipv6PrefixValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## ipv6-address.h (module 'network'): ns3::Ipv6Prefix ns3::Ipv6PrefixValue::Get() const [member function]
cls.add_method('Get',
'ns3::Ipv6Prefix',
[],
is_const=True)
## ipv6-address.h (module 'network'): std::string ns3::Ipv6PrefixValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## ipv6-address.h (module 'network'): void ns3::Ipv6PrefixValue::Set(ns3::Ipv6Prefix const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Ipv6Prefix const &', 'value')])
return
def register_Ns3LogNormalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::LogNormalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::LogNormalRandomVariable::LogNormalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetMu() const [member function]
cls.add_method('GetMu',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetSigma() const [member function]
cls.add_method('GetSigma',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue(double mu, double sigma) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mu'), param('double', 'sigma')])
## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger(uint32_t mu, uint32_t sigma) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mu'), param('uint32_t', 'sigma')])
## random-variable-stream.h (module 'core'): double ns3::LogNormalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::LogNormalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3Mac48AddressChecker_methods(root_module, cls):
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48AddressChecker::Mac48AddressChecker(ns3::Mac48AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48AddressChecker const &', 'arg0')])
return
def register_Ns3Mac48AddressValue_methods(root_module, cls):
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue() [constructor]
cls.add_constructor([])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48Address const & value) [constructor]
cls.add_constructor([param('ns3::Mac48Address const &', 'value')])
## mac48-address.h (module 'network'): ns3::Mac48AddressValue::Mac48AddressValue(ns3::Mac48AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::Mac48AddressValue const &', 'arg0')])
## mac48-address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::Mac48AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## mac48-address.h (module 'network'): bool ns3::Mac48AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## mac48-address.h (module 'network'): ns3::Mac48Address ns3::Mac48AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Mac48Address',
[],
is_const=True)
## mac48-address.h (module 'network'): std::string ns3::Mac48AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## mac48-address.h (module 'network'): void ns3::Mac48AddressValue::Set(ns3::Mac48Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Mac48Address const &', 'value')])
return
def register_Ns3NetDevice_methods(root_module, cls):
## net-device.h (module 'network'): ns3::NetDevice::NetDevice() [constructor]
cls.add_constructor([])
## net-device.h (module 'network'): ns3::NetDevice::NetDevice(ns3::NetDevice const & arg0) [constructor]
cls.add_constructor([param('ns3::NetDevice const &', 'arg0')])
## net-device.h (module 'network'): void ns3::NetDevice::AddLinkChangeCallback(ns3::Callback<void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> callback) [member function]
cls.add_method('AddLinkChangeCallback',
'void',
[param('ns3::Callback< void, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'callback')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetAddress() const [member function]
cls.add_method('GetAddress',
'ns3::Address',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetBroadcast() const [member function]
cls.add_method('GetBroadcast',
'ns3::Address',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Ptr<ns3::Channel> ns3::NetDevice::GetChannel() const [member function]
cls.add_method('GetChannel',
'ns3::Ptr< ns3::Channel >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): uint32_t ns3::NetDevice::GetIfIndex() const [member function]
cls.add_method('GetIfIndex',
'uint32_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): uint16_t ns3::NetDevice::GetMtu() const [member function]
cls.add_method('GetMtu',
'uint16_t',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv4Address multicastGroup) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv4Address', 'multicastGroup')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Address ns3::NetDevice::GetMulticast(ns3::Ipv6Address addr) const [member function]
cls.add_method('GetMulticast',
'ns3::Address',
[param('ns3::Ipv6Address', 'addr')],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): ns3::Ptr<ns3::Node> ns3::NetDevice::GetNode() const [member function]
cls.add_method('GetNode',
'ns3::Ptr< ns3::Node >',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): static ns3::TypeId ns3::NetDevice::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsBridge() const [member function]
cls.add_method('IsBridge',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsBroadcast() const [member function]
cls.add_method('IsBroadcast',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsLinkUp() const [member function]
cls.add_method('IsLinkUp',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsMulticast() const [member function]
cls.add_method('IsMulticast',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::IsPointToPoint() const [member function]
cls.add_method('IsPointToPoint',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::NeedsArp() const [member function]
cls.add_method('NeedsArp',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::Send(ns3::Ptr<ns3::Packet> packet, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('Send',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SendFrom(ns3::Ptr<ns3::Packet> packet, ns3::Address const & source, ns3::Address const & dest, uint16_t protocolNumber) [member function]
cls.add_method('SendFrom',
'bool',
[param('ns3::Ptr< ns3::Packet >', 'packet'), param('ns3::Address const &', 'source'), param('ns3::Address const &', 'dest'), param('uint16_t', 'protocolNumber')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetAddress(ns3::Address address) [member function]
cls.add_method('SetAddress',
'void',
[param('ns3::Address', 'address')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetIfIndex(uint32_t const index) [member function]
cls.add_method('SetIfIndex',
'void',
[param('uint32_t const', 'index')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SetMtu(uint16_t const mtu) [member function]
cls.add_method('SetMtu',
'bool',
[param('uint16_t const', 'mtu')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetNode(ns3::Ptr<ns3::Node> node) [member function]
cls.add_method('SetNode',
'void',
[param('ns3::Ptr< ns3::Node >', 'node')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetPromiscReceiveCallback(ns3::NetDevice::PromiscReceiveCallback cb) [member function]
cls.add_method('SetPromiscReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): void ns3::NetDevice::SetReceiveCallback(ns3::NetDevice::ReceiveCallback cb) [member function]
cls.add_method('SetReceiveCallback',
'void',
[param('ns3::Callback< bool, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'cb')],
is_pure_virtual=True, is_virtual=True)
## net-device.h (module 'network'): bool ns3::NetDevice::SupportsSendFrom() const [member function]
cls.add_method('SupportsSendFrom',
'bool',
[],
is_pure_virtual=True, is_const=True, is_virtual=True)
return
def register_Ns3NixVector_methods(root_module, cls):
cls.add_output_stream_operator()
## nix-vector.h (module 'network'): ns3::NixVector::NixVector() [constructor]
cls.add_constructor([])
## nix-vector.h (module 'network'): ns3::NixVector::NixVector(ns3::NixVector const & o) [constructor]
cls.add_constructor([param('ns3::NixVector const &', 'o')])
## nix-vector.h (module 'network'): void ns3::NixVector::AddNeighborIndex(uint32_t newBits, uint32_t numberOfBits) [member function]
cls.add_method('AddNeighborIndex',
'void',
[param('uint32_t', 'newBits'), param('uint32_t', 'numberOfBits')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::BitCount(uint32_t numberOfNeighbors) const [member function]
cls.add_method('BitCount',
'uint32_t',
[param('uint32_t', 'numberOfNeighbors')],
is_const=True)
## nix-vector.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::NixVector::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::NixVector >',
[],
is_const=True)
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Deserialize(uint32_t const * buffer, uint32_t size) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('uint32_t const *', 'buffer'), param('uint32_t', 'size')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::ExtractNeighborIndex(uint32_t numberOfBits) [member function]
cls.add_method('ExtractNeighborIndex',
'uint32_t',
[param('uint32_t', 'numberOfBits')])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetRemainingBits() [member function]
cls.add_method('GetRemainingBits',
'uint32_t',
[])
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## nix-vector.h (module 'network'): uint32_t ns3::NixVector::Serialize(uint32_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint32_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
return
def register_Ns3Node_methods(root_module, cls):
## node.h (module 'network'): ns3::Node::Node(ns3::Node const & arg0) [constructor]
cls.add_constructor([param('ns3::Node const &', 'arg0')])
## node.h (module 'network'): ns3::Node::Node() [constructor]
cls.add_constructor([])
## node.h (module 'network'): ns3::Node::Node(uint32_t systemId) [constructor]
cls.add_constructor([param('uint32_t', 'systemId')])
## node.h (module 'network'): uint32_t ns3::Node::AddApplication(ns3::Ptr<ns3::Application> application) [member function]
cls.add_method('AddApplication',
'uint32_t',
[param('ns3::Ptr< ns3::Application >', 'application')])
## node.h (module 'network'): uint32_t ns3::Node::AddDevice(ns3::Ptr<ns3::NetDevice> device) [member function]
cls.add_method('AddDevice',
'uint32_t',
[param('ns3::Ptr< ns3::NetDevice >', 'device')])
## node.h (module 'network'): static bool ns3::Node::ChecksumEnabled() [member function]
cls.add_method('ChecksumEnabled',
'bool',
[],
is_static=True)
## node.h (module 'network'): ns3::Ptr<ns3::Application> ns3::Node::GetApplication(uint32_t index) const [member function]
cls.add_method('GetApplication',
'ns3::Ptr< ns3::Application >',
[param('uint32_t', 'index')],
is_const=True)
## node.h (module 'network'): ns3::Ptr<ns3::NetDevice> ns3::Node::GetDevice(uint32_t index) const [member function]
cls.add_method('GetDevice',
'ns3::Ptr< ns3::NetDevice >',
[param('uint32_t', 'index')],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetId() const [member function]
cls.add_method('GetId',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): ns3::Time ns3::Node::GetLocalTime() const [member function]
cls.add_method('GetLocalTime',
'ns3::Time',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetNApplications() const [member function]
cls.add_method('GetNApplications',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetNDevices() const [member function]
cls.add_method('GetNDevices',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): uint32_t ns3::Node::GetSystemId() const [member function]
cls.add_method('GetSystemId',
'uint32_t',
[],
is_const=True)
## node.h (module 'network'): static ns3::TypeId ns3::Node::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## node.h (module 'network'): void ns3::Node::RegisterDeviceAdditionListener(ns3::Node::DeviceAdditionListener listener) [member function]
cls.add_method('RegisterDeviceAdditionListener',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')])
## node.h (module 'network'): void ns3::Node::RegisterProtocolHandler(ns3::Node::ProtocolHandler handler, uint16_t protocolType, ns3::Ptr<ns3::NetDevice> device, bool promiscuous=false) [member function]
cls.add_method('RegisterProtocolHandler',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler'), param('uint16_t', 'protocolType'), param('ns3::Ptr< ns3::NetDevice >', 'device'), param('bool', 'promiscuous', default_value='false')])
## node.h (module 'network'): void ns3::Node::UnregisterDeviceAdditionListener(ns3::Node::DeviceAdditionListener listener) [member function]
cls.add_method('UnregisterDeviceAdditionListener',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'listener')])
## node.h (module 'network'): void ns3::Node::UnregisterProtocolHandler(ns3::Node::ProtocolHandler handler) [member function]
cls.add_method('UnregisterProtocolHandler',
'void',
[param('ns3::Callback< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty >', 'handler')])
## node.h (module 'network'): void ns3::Node::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## node.h (module 'network'): void ns3::Node::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3NormalRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::INFINITE_VALUE [variable]
cls.add_static_attribute('INFINITE_VALUE', 'double const', is_const=True)
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::NormalRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::NormalRandomVariable::NormalRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetVariance() const [member function]
cls.add_method('GetVariance',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue(double mean, double variance, double bound=ns3::NormalRandomVariable::INFINITE_VALUE) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'mean'), param('double', 'variance'), param('double', 'bound', default_value='ns3::NormalRandomVariable::INFINITE_VALUE')])
## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger(uint32_t mean, uint32_t variance, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'mean'), param('uint32_t', 'variance'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::NormalRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::NormalRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3ObjectFactoryChecker_methods(root_module, cls):
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactoryChecker::ObjectFactoryChecker(ns3::ObjectFactoryChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactoryChecker const &', 'arg0')])
return
def register_Ns3ObjectFactoryValue_methods(root_module, cls):
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue() [constructor]
cls.add_constructor([])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactory const & value) [constructor]
cls.add_constructor([param('ns3::ObjectFactory const &', 'value')])
## object-factory.h (module 'core'): ns3::ObjectFactoryValue::ObjectFactoryValue(ns3::ObjectFactoryValue const & arg0) [constructor]
cls.add_constructor([param('ns3::ObjectFactoryValue const &', 'arg0')])
## object-factory.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::ObjectFactoryValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## object-factory.h (module 'core'): bool ns3::ObjectFactoryValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## object-factory.h (module 'core'): ns3::ObjectFactory ns3::ObjectFactoryValue::Get() const [member function]
cls.add_method('Get',
'ns3::ObjectFactory',
[],
is_const=True)
## object-factory.h (module 'core'): std::string ns3::ObjectFactoryValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## object-factory.h (module 'core'): void ns3::ObjectFactoryValue::Set(ns3::ObjectFactory const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::ObjectFactory const &', 'value')])
return
def register_Ns3OutputStreamWrapper_methods(root_module, cls):
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(ns3::OutputStreamWrapper const & arg0) [constructor]
cls.add_constructor([param('ns3::OutputStreamWrapper const &', 'arg0')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::string filename, std::ios_base::openmode filemode) [constructor]
cls.add_constructor([param('std::string', 'filename'), param('std::ios_base::openmode', 'filemode')])
## output-stream-wrapper.h (module 'network'): ns3::OutputStreamWrapper::OutputStreamWrapper(std::ostream * os) [constructor]
cls.add_constructor([param('std::ostream *', 'os')])
## output-stream-wrapper.h (module 'network'): std::ostream * ns3::OutputStreamWrapper::GetStream() [member function]
cls.add_method('GetStream',
'std::ostream *',
[])
return
def register_Ns3Packet_methods(root_module, cls):
cls.add_output_stream_operator()
## packet.h (module 'network'): ns3::Packet::Packet() [constructor]
cls.add_constructor([])
## packet.h (module 'network'): ns3::Packet::Packet(ns3::Packet const & o) [constructor]
cls.add_constructor([param('ns3::Packet const &', 'o')])
## packet.h (module 'network'): ns3::Packet::Packet(uint32_t size) [constructor]
cls.add_constructor([param('uint32_t', 'size')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size, bool magic) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size'), param('bool', 'magic')])
## packet.h (module 'network'): ns3::Packet::Packet(uint8_t const * buffer, uint32_t size) [constructor]
cls.add_constructor([param('uint8_t const *', 'buffer'), param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddAtEnd(ns3::Ptr<const ns3::Packet> packet) [member function]
cls.add_method('AddAtEnd',
'void',
[param('ns3::Ptr< ns3::Packet const >', 'packet')])
## packet.h (module 'network'): void ns3::Packet::AddByteTag(ns3::Tag const & tag) const [member function]
cls.add_method('AddByteTag',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddHeader(ns3::Header const & header) [member function]
cls.add_method('AddHeader',
'void',
[param('ns3::Header const &', 'header')])
## packet.h (module 'network'): void ns3::Packet::AddPacketTag(ns3::Tag const & tag) const [member function]
cls.add_method('AddPacketTag',
'void',
[param('ns3::Tag const &', 'tag')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::AddPaddingAtEnd(uint32_t size) [member function]
cls.add_method('AddPaddingAtEnd',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::AddTrailer(ns3::Trailer const & trailer) [member function]
cls.add_method('AddTrailer',
'void',
[param('ns3::Trailer const &', 'trailer')])
## packet.h (module 'network'): ns3::PacketMetadata::ItemIterator ns3::Packet::BeginItem() const [member function]
cls.add_method('BeginItem',
'ns3::PacketMetadata::ItemIterator',
[],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::Packet >',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::CopyData(uint8_t * buffer, uint32_t size) const [member function]
cls.add_method('CopyData',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::CopyData(std::ostream * os, uint32_t size) const [member function]
cls.add_method('CopyData',
'void',
[param('std::ostream *', 'os'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::Packet> ns3::Packet::CreateFragment(uint32_t start, uint32_t length) const [member function]
cls.add_method('CreateFragment',
'ns3::Ptr< ns3::Packet >',
[param('uint32_t', 'start'), param('uint32_t', 'length')],
is_const=True)
## packet.h (module 'network'): static void ns3::Packet::EnableChecking() [member function]
cls.add_method('EnableChecking',
'void',
[],
is_static=True)
## packet.h (module 'network'): static void ns3::Packet::EnablePrinting() [member function]
cls.add_method('EnablePrinting',
'void',
[],
is_static=True)
## packet.h (module 'network'): bool ns3::Packet::FindFirstMatchingByteTag(ns3::Tag & tag) const [member function]
cls.add_method('FindFirstMatchingByteTag',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): ns3::ByteTagIterator ns3::Packet::GetByteTagIterator() const [member function]
cls.add_method('GetByteTagIterator',
'ns3::ByteTagIterator',
[],
is_const=True)
## packet.h (module 'network'): ns3::Ptr<ns3::NixVector> ns3::Packet::GetNixVector() const [member function]
cls.add_method('GetNixVector',
'ns3::Ptr< ns3::NixVector >',
[],
is_const=True)
## packet.h (module 'network'): ns3::PacketTagIterator ns3::Packet::GetPacketTagIterator() const [member function]
cls.add_method('GetPacketTagIterator',
'ns3::PacketTagIterator',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::GetSize() const [member function]
cls.add_method('GetSize',
'uint32_t',
[],
is_const=True)
## packet.h (module 'network'): uint64_t ns3::Packet::GetUid() const [member function]
cls.add_method('GetUid',
'uint64_t',
[],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header) const [member function]
cls.add_method('PeekHeader',
'uint32_t',
[param('ns3::Header &', 'header')],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekHeader(ns3::Header & header, uint32_t size) const [member function]
cls.add_method('PeekHeader',
'uint32_t',
[param('ns3::Header &', 'header'), param('uint32_t', 'size')],
is_const=True)
## packet.h (module 'network'): bool ns3::Packet::PeekPacketTag(ns3::Tag & tag) const [member function]
cls.add_method('PeekPacketTag',
'bool',
[param('ns3::Tag &', 'tag')],
is_const=True)
## packet.h (module 'network'): uint32_t ns3::Packet::PeekTrailer(ns3::Trailer & trailer) [member function]
cls.add_method('PeekTrailer',
'uint32_t',
[param('ns3::Trailer &', 'trailer')])
## packet.h (module 'network'): void ns3::Packet::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::PrintByteTags(std::ostream & os) const [member function]
cls.add_method('PrintByteTags',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::PrintPacketTags(std::ostream & os) const [member function]
cls.add_method('PrintPacketTags',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::RemoveAllByteTags() [member function]
cls.add_method('RemoveAllByteTags',
'void',
[])
## packet.h (module 'network'): void ns3::Packet::RemoveAllPacketTags() [member function]
cls.add_method('RemoveAllPacketTags',
'void',
[])
## packet.h (module 'network'): void ns3::Packet::RemoveAtEnd(uint32_t size) [member function]
cls.add_method('RemoveAtEnd',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): void ns3::Packet::RemoveAtStart(uint32_t size) [member function]
cls.add_method('RemoveAtStart',
'void',
[param('uint32_t', 'size')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header) [member function]
cls.add_method('RemoveHeader',
'uint32_t',
[param('ns3::Header &', 'header')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveHeader(ns3::Header & header, uint32_t size) [member function]
cls.add_method('RemoveHeader',
'uint32_t',
[param('ns3::Header &', 'header'), param('uint32_t', 'size')])
## packet.h (module 'network'): bool ns3::Packet::RemovePacketTag(ns3::Tag & tag) [member function]
cls.add_method('RemovePacketTag',
'bool',
[param('ns3::Tag &', 'tag')])
## packet.h (module 'network'): uint32_t ns3::Packet::RemoveTrailer(ns3::Trailer & trailer) [member function]
cls.add_method('RemoveTrailer',
'uint32_t',
[param('ns3::Trailer &', 'trailer')])
## packet.h (module 'network'): bool ns3::Packet::ReplacePacketTag(ns3::Tag & tag) [member function]
cls.add_method('ReplacePacketTag',
'bool',
[param('ns3::Tag &', 'tag')])
## packet.h (module 'network'): uint32_t ns3::Packet::Serialize(uint8_t * buffer, uint32_t maxSize) const [member function]
cls.add_method('Serialize',
'uint32_t',
[param('uint8_t *', 'buffer'), param('uint32_t', 'maxSize')],
is_const=True)
## packet.h (module 'network'): void ns3::Packet::SetNixVector(ns3::Ptr<ns3::NixVector> nixVector) [member function]
cls.add_method('SetNixVector',
'void',
[param('ns3::Ptr< ns3::NixVector >', 'nixVector')])
## packet.h (module 'network'): std::string ns3::Packet::ToString() const [member function]
cls.add_method('ToString',
'std::string',
[],
is_const=True)
return
def register_Ns3ParetoRandomVariable_methods(root_module, cls):
## random-variable-stream.h (module 'core'): static ns3::TypeId ns3::ParetoRandomVariable::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## random-variable-stream.h (module 'core'): ns3::ParetoRandomVariable::ParetoRandomVariable() [constructor]
cls.add_constructor([])
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetMean() const [member function]
cls.add_method('GetMean',
'double',
[],
deprecated=True, is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetScale() const [member function]
cls.add_method('GetScale',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetShape() const [member function]
cls.add_method('GetShape',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetBound() const [member function]
cls.add_method('GetBound',
'double',
[],
is_const=True)
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue(double scale, double shape, double bound) [member function]
cls.add_method('GetValue',
'double',
[param('double', 'scale'), param('double', 'shape'), param('double', 'bound')])
## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger(uint32_t scale, uint32_t shape, uint32_t bound) [member function]
cls.add_method('GetInteger',
'uint32_t',
[param('uint32_t', 'scale'), param('uint32_t', 'shape'), param('uint32_t', 'bound')])
## random-variable-stream.h (module 'core'): double ns3::ParetoRandomVariable::GetValue() [member function]
cls.add_method('GetValue',
'double',
[],
is_virtual=True)
## random-variable-stream.h (module 'core'): uint32_t ns3::ParetoRandomVariable::GetInteger() [member function]
cls.add_method('GetInteger',
'uint32_t',
[],
is_virtual=True)
return
def register_Ns3TimeValue_methods(root_module, cls):
## nstime.h (module 'core'): ns3::TimeValue::TimeValue() [constructor]
cls.add_constructor([])
## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::Time const & value) [constructor]
cls.add_constructor([param('ns3::Time const &', 'value')])
## nstime.h (module 'core'): ns3::TimeValue::TimeValue(ns3::TimeValue const & arg0) [constructor]
cls.add_constructor([param('ns3::TimeValue const &', 'arg0')])
## nstime.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TimeValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## nstime.h (module 'core'): bool ns3::TimeValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## nstime.h (module 'core'): ns3::Time ns3::TimeValue::Get() const [member function]
cls.add_method('Get',
'ns3::Time',
[],
is_const=True)
## nstime.h (module 'core'): std::string ns3::TimeValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## nstime.h (module 'core'): void ns3::TimeValue::Set(ns3::Time const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Time const &', 'value')])
return
def register_Ns3TypeIdChecker_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeIdChecker::TypeIdChecker(ns3::TypeIdChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeIdChecker const &', 'arg0')])
return
def register_Ns3TypeIdValue_methods(root_module, cls):
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue() [constructor]
cls.add_constructor([])
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeId const & value) [constructor]
cls.add_constructor([param('ns3::TypeId const &', 'value')])
## type-id.h (module 'core'): ns3::TypeIdValue::TypeIdValue(ns3::TypeIdValue const & arg0) [constructor]
cls.add_constructor([param('ns3::TypeIdValue const &', 'arg0')])
## type-id.h (module 'core'): ns3::Ptr<ns3::AttributeValue> ns3::TypeIdValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## type-id.h (module 'core'): bool ns3::TypeIdValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## type-id.h (module 'core'): ns3::TypeId ns3::TypeIdValue::Get() const [member function]
cls.add_method('Get',
'ns3::TypeId',
[],
is_const=True)
## type-id.h (module 'core'): std::string ns3::TypeIdValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## type-id.h (module 'core'): void ns3::TypeIdValue::Set(ns3::TypeId const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::TypeId const &', 'value')])
return
def register_Ns3AddressChecker_methods(root_module, cls):
## address.h (module 'network'): ns3::AddressChecker::AddressChecker() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::AddressChecker::AddressChecker(ns3::AddressChecker const & arg0) [constructor]
cls.add_constructor([param('ns3::AddressChecker const &', 'arg0')])
return
def register_Ns3AddressValue_methods(root_module, cls):
## address.h (module 'network'): ns3::AddressValue::AddressValue() [constructor]
cls.add_constructor([])
## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::Address const & value) [constructor]
cls.add_constructor([param('ns3::Address const &', 'value')])
## address.h (module 'network'): ns3::AddressValue::AddressValue(ns3::AddressValue const & arg0) [constructor]
cls.add_constructor([param('ns3::AddressValue const &', 'arg0')])
## address.h (module 'network'): ns3::Ptr<ns3::AttributeValue> ns3::AddressValue::Copy() const [member function]
cls.add_method('Copy',
'ns3::Ptr< ns3::AttributeValue >',
[],
is_const=True, is_virtual=True)
## address.h (module 'network'): bool ns3::AddressValue::DeserializeFromString(std::string value, ns3::Ptr<const ns3::AttributeChecker> checker) [member function]
cls.add_method('DeserializeFromString',
'bool',
[param('std::string', 'value'), param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_virtual=True)
## address.h (module 'network'): ns3::Address ns3::AddressValue::Get() const [member function]
cls.add_method('Get',
'ns3::Address',
[],
is_const=True)
## address.h (module 'network'): std::string ns3::AddressValue::SerializeToString(ns3::Ptr<const ns3::AttributeChecker> checker) const [member function]
cls.add_method('SerializeToString',
'std::string',
[param('ns3::Ptr< ns3::AttributeChecker const >', 'checker')],
is_const=True, is_virtual=True)
## address.h (module 'network'): void ns3::AddressValue::Set(ns3::Address const & value) [member function]
cls.add_method('Set',
'void',
[param('ns3::Address const &', 'value')])
return
def register_Ns3CallbackImpl__Bool_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< bool, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): bool ns3::CallbackImpl<bool, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'bool',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('ns3::Address const &', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Ns3ObjectBase___star___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): ns3::ObjectBase * ns3::CallbackImpl<ns3::ObjectBase *, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()() [member operator]
cls.add_method('operator()',
'ns3::ObjectBase *',
[],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Const_ns3OlsrPacketHeader___amp___Const_stdVector__lt__ns3OlsrMessageHeader__stdAllocator__lt__ns3OlsrMessageHeader__gt_____gt_____amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::olsr::PacketHeader const &, std::vector< ns3::olsr::MessageHeader, std::allocator< ns3::olsr::MessageHeader > > const, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, const ns3::olsr::PacketHeader &, const std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::olsr::PacketHeader const & arg0, std::vector<ns3::olsr::MessageHeader, std::allocator<ns3::olsr::MessageHeader> > const & arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::olsr::PacketHeader const &', 'arg0'), param('std::vector< ns3::olsr::MessageHeader > const &', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
cls.add_copy_constructor()
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Ptr__lt__const_ns3Packet__gt___Unsigned_short_Const_ns3Address___amp___Const_ns3Address___amp___Ns3NetDevicePacketType_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::NetDevice >, ns3::Ptr< ns3::Packet const >, unsigned short, ns3::Address const &, ns3::Address const &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::Ptr<const ns3::Packet>, unsigned short, const ns3::Address &, const ns3::Address &, ns3::NetDevice::PacketType, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice> arg0, ns3::Ptr<const ns3::Packet> arg1, short unsigned int arg2, ns3::Address const & arg3, ns3::Address const & arg4, ns3::NetDevice::PacketType arg5) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0'), param('ns3::Ptr< ns3::Packet const >', 'arg1'), param('short unsigned int', 'arg2'), param('ns3::Address const &', 'arg3'), param('ns3::Address const &', 'arg4'), param('ns3::NetDevice::PacketType', 'arg5')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3NetDevice__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::NetDevice >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::NetDevice>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::NetDevice> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::NetDevice >', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Const_ns3Address___amp___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, ns3::Address const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, const ns3::Address &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, ns3::Address const & arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('ns3::Address const &', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Ns3Ptr__lt__ns3Socket__gt___Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, ns3::Ptr< ns3::Socket >, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, ns3::Ptr<ns3::Socket>, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(ns3::Ptr<ns3::Socket> arg0, unsigned int arg1) [member operator]
cls.add_method('operator()',
'void',
[param('ns3::Ptr< ns3::Socket >', 'arg0'), param('unsigned int', 'arg1')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3CallbackImpl__Void_Unsigned_int_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_Ns3Empty_methods(root_module, cls):
## callback.h (module 'core'): ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl() [constructor]
cls.add_constructor([])
## callback.h (module 'core'): ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::CallbackImpl(ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty> const & arg0) [constructor]
cls.add_constructor([param('ns3::CallbackImpl< void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty > const &', 'arg0')])
## callback.h (module 'core'): static std::string ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::DoGetTypeid() [member function]
cls.add_method('DoGetTypeid',
'std::string',
[],
is_static=True)
## callback.h (module 'core'): std::string ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::GetTypeid() const [member function]
cls.add_method('GetTypeid',
'std::string',
[],
is_const=True, is_virtual=True)
## callback.h (module 'core'): void ns3::CallbackImpl<void, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty>::operator()(unsigned int arg0) [member operator]
cls.add_method('operator()',
'void',
[param('unsigned int', 'arg0')],
is_pure_virtual=True, is_virtual=True, custom_name=u'__call__')
return
def register_Ns3Ipv4ListRouting_methods(root_module, cls):
## ipv4-list-routing.h (module 'internet'): ns3::Ipv4ListRouting::Ipv4ListRouting(ns3::Ipv4ListRouting const & arg0) [constructor]
cls.add_constructor([param('ns3::Ipv4ListRouting const &', 'arg0')])
## ipv4-list-routing.h (module 'internet'): ns3::Ipv4ListRouting::Ipv4ListRouting() [constructor]
cls.add_constructor([])
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::AddRoutingProtocol(ns3::Ptr<ns3::Ipv4RoutingProtocol> routingProtocol, int16_t priority) [member function]
cls.add_method('AddRoutingProtocol',
'void',
[param('ns3::Ptr< ns3::Ipv4RoutingProtocol >', 'routingProtocol'), param('int16_t', 'priority')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): uint32_t ns3::Ipv4ListRouting::GetNRoutingProtocols() const [member function]
cls.add_method('GetNRoutingProtocols',
'uint32_t',
[],
is_const=True, is_virtual=True)
## ipv4-list-routing.h (module 'internet'): ns3::Ptr<ns3::Ipv4RoutingProtocol> ns3::Ipv4ListRouting::GetRoutingProtocol(uint32_t index, int16_t & priority) const [member function]
cls.add_method('GetRoutingProtocol',
'ns3::Ptr< ns3::Ipv4RoutingProtocol >',
[param('uint32_t', 'index'), param('int16_t &', 'priority', direction=2)],
is_const=True, is_virtual=True)
## ipv4-list-routing.h (module 'internet'): static ns3::TypeId ns3::Ipv4ListRouting::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyAddAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::NotifyInterfaceDown(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceDown',
'void',
[param('uint32_t', 'interface')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::NotifyInterfaceUp(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceUp',
'void',
[param('uint32_t', 'interface')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyRemoveAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_const=True, is_virtual=True)
## ipv4-list-routing.h (module 'internet'): bool ns3::Ipv4ListRouting::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Ipv4RoutingProtocol::UnicastForwardCallback ucb, ns3::Ipv4RoutingProtocol::MulticastForwardCallback mcb, ns3::Ipv4RoutingProtocol::LocalDeliverCallback lcb, ns3::Ipv4RoutingProtocol::ErrorCallback ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): ns3::Ptr<ns3::Ipv4Route> ns3::Ipv4ListRouting::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='protected', is_virtual=True)
## ipv4-list-routing.h (module 'internet'): void ns3::Ipv4ListRouting::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
return
def register_Ns3HashImplementation_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation(ns3::Hash::Implementation const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Implementation const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Implementation::Implementation() [constructor]
cls.add_constructor([])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Implementation::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_pure_virtual=True, is_virtual=True)
## hash-function.h (module 'core'): uint64_t ns3::Hash::Implementation::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Implementation::clear() [member function]
cls.add_method('clear',
'void',
[],
is_pure_virtual=True, is_virtual=True)
return
def register_Ns3HashFunctionFnv1a_methods(root_module, cls):
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a(ns3::Hash::Function::Fnv1a const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Fnv1a const &', 'arg0')])
## hash-fnv.h (module 'core'): ns3::Hash::Function::Fnv1a::Fnv1a() [constructor]
cls.add_constructor([])
## hash-fnv.h (module 'core'): uint32_t ns3::Hash::Function::Fnv1a::GetHash32(char const * buffer, size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('size_t const', 'size')],
is_virtual=True)
## hash-fnv.h (module 'core'): uint64_t ns3::Hash::Function::Fnv1a::GetHash64(char const * buffer, size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('size_t const', 'size')],
is_virtual=True)
## hash-fnv.h (module 'core'): void ns3::Hash::Function::Fnv1a::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionHash32_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Function::Hash32 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Hash32 const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash32::Hash32(ns3::Hash::Hash32Function_ptr hp) [constructor]
cls.add_constructor([param('ns3::Hash::Hash32Function_ptr', 'hp')])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash32::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Function::Hash32::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionHash64_methods(root_module, cls):
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Function::Hash64 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Hash64 const &', 'arg0')])
## hash-function.h (module 'core'): ns3::Hash::Function::Hash64::Hash64(ns3::Hash::Hash64Function_ptr hp) [constructor]
cls.add_constructor([param('ns3::Hash::Hash64Function_ptr', 'hp')])
## hash-function.h (module 'core'): uint32_t ns3::Hash::Function::Hash64::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): uint64_t ns3::Hash::Function::Hash64::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-function.h (module 'core'): void ns3::Hash::Function::Hash64::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3HashFunctionMurmur3_methods(root_module, cls):
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3(ns3::Hash::Function::Murmur3 const & arg0) [constructor]
cls.add_constructor([param('ns3::Hash::Function::Murmur3 const &', 'arg0')])
## hash-murmur3.h (module 'core'): ns3::Hash::Function::Murmur3::Murmur3() [constructor]
cls.add_constructor([])
## hash-murmur3.h (module 'core'): uint32_t ns3::Hash::Function::Murmur3::GetHash32(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash32',
'uint32_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-murmur3.h (module 'core'): uint64_t ns3::Hash::Function::Murmur3::GetHash64(char const * buffer, std::size_t const size) [member function]
cls.add_method('GetHash64',
'uint64_t',
[param('char const *', 'buffer'), param('std::size_t const', 'size')],
is_virtual=True)
## hash-murmur3.h (module 'core'): void ns3::Hash::Function::Murmur3::clear() [member function]
cls.add_method('clear',
'void',
[],
is_virtual=True)
return
def register_Ns3OlsrAssociation_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_output_stream_operator()
## olsr-repositories.h (module 'olsr'): ns3::olsr::Association::Association() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::Association::Association(ns3::olsr::Association const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::Association const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::Association::netmask [variable]
cls.add_instance_attribute('netmask', 'ns3::Ipv4Mask', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::Association::networkAddr [variable]
cls.add_instance_attribute('networkAddr', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3OlsrAssociationTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_output_stream_operator()
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple::AssociationTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple::AssociationTuple(ns3::olsr::AssociationTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::AssociationTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple::expirationTime [variable]
cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple::gatewayAddr [variable]
cls.add_instance_attribute('gatewayAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple::netmask [variable]
cls.add_instance_attribute('netmask', 'ns3::Ipv4Mask', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::AssociationTuple::networkAddr [variable]
cls.add_instance_attribute('networkAddr', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3OlsrDuplicateTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::DuplicateTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::DuplicateTuple(ns3::olsr::DuplicateTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::DuplicateTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::address [variable]
cls.add_instance_attribute('address', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::expirationTime [variable]
cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::ifaceList [variable]
cls.add_instance_attribute('ifaceList', 'std::vector< ns3::Ipv4Address >', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::retransmitted [variable]
cls.add_instance_attribute('retransmitted', 'bool', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::DuplicateTuple::sequenceNumber [variable]
cls.add_instance_attribute('sequenceNumber', 'uint16_t', is_const=False)
return
def register_Ns3OlsrIfaceAssocTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_output_stream_operator()
## olsr-repositories.h (module 'olsr'): ns3::olsr::IfaceAssocTuple::IfaceAssocTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::IfaceAssocTuple::IfaceAssocTuple(ns3::olsr::IfaceAssocTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::IfaceAssocTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::IfaceAssocTuple::ifaceAddr [variable]
cls.add_instance_attribute('ifaceAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::IfaceAssocTuple::mainAddr [variable]
cls.add_instance_attribute('mainAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::IfaceAssocTuple::time [variable]
cls.add_instance_attribute('time', 'ns3::Time', is_const=False)
return
def register_Ns3OlsrLinkTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_output_stream_operator()
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::LinkTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::LinkTuple(ns3::olsr::LinkTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::LinkTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::asymTime [variable]
cls.add_instance_attribute('asymTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::localIfaceAddr [variable]
cls.add_instance_attribute('localIfaceAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::neighborIfaceAddr [variable]
cls.add_instance_attribute('neighborIfaceAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::symTime [variable]
cls.add_instance_attribute('symTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::LinkTuple::time [variable]
cls.add_instance_attribute('time', 'ns3::Time', is_const=False)
return
def register_Ns3OlsrMessageHeader_methods(root_module, cls):
cls.add_output_stream_operator()
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::MessageHeader(ns3::olsr::MessageHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader const &', 'arg0')])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::MessageHeader() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello & ns3::olsr::MessageHeader::GetHello() [member function]
cls.add_method('GetHello',
'ns3::olsr::MessageHeader::Hello &',
[])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello const & ns3::olsr::MessageHeader::GetHello() const [member function]
cls.add_method('GetHello',
'ns3::olsr::MessageHeader::Hello const &',
[],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna & ns3::olsr::MessageHeader::GetHna() [member function]
cls.add_method('GetHna',
'ns3::olsr::MessageHeader::Hna &',
[])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna const & ns3::olsr::MessageHeader::GetHna() const [member function]
cls.add_method('GetHna',
'ns3::olsr::MessageHeader::Hna const &',
[],
is_const=True)
## olsr-header.h (module 'olsr'): uint8_t ns3::olsr::MessageHeader::GetHopCount() const [member function]
cls.add_method('GetHopCount',
'uint8_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::TypeId ns3::olsr::MessageHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): uint16_t ns3::olsr::MessageHeader::GetMessageSequenceNumber() const [member function]
cls.add_method('GetMessageSequenceNumber',
'uint16_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::MessageType ns3::olsr::MessageHeader::GetMessageType() const [member function]
cls.add_method('GetMessageType',
'ns3::olsr::MessageHeader::MessageType',
[],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Mid & ns3::olsr::MessageHeader::GetMid() [member function]
cls.add_method('GetMid',
'ns3::olsr::MessageHeader::Mid &',
[])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Mid const & ns3::olsr::MessageHeader::GetMid() const [member function]
cls.add_method('GetMid',
'ns3::olsr::MessageHeader::Mid const &',
[],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::Ipv4Address ns3::olsr::MessageHeader::GetOriginatorAddress() const [member function]
cls.add_method('GetOriginatorAddress',
'ns3::Ipv4Address',
[],
is_const=True)
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc & ns3::olsr::MessageHeader::GetTc() [member function]
cls.add_method('GetTc',
'ns3::olsr::MessageHeader::Tc &',
[])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc const & ns3::olsr::MessageHeader::GetTc() const [member function]
cls.add_method('GetTc',
'ns3::olsr::MessageHeader::Tc const &',
[],
is_const=True)
## olsr-header.h (module 'olsr'): uint8_t ns3::olsr::MessageHeader::GetTimeToLive() const [member function]
cls.add_method('GetTimeToLive',
'uint8_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): static ns3::TypeId ns3::olsr::MessageHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## olsr-header.h (module 'olsr'): ns3::Time ns3::olsr::MessageHeader::GetVTime() const [member function]
cls.add_method('GetVTime',
'ns3::Time',
[],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::SetHopCount(uint8_t hopCount) [member function]
cls.add_method('SetHopCount',
'void',
[param('uint8_t', 'hopCount')])
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::SetMessageSequenceNumber(uint16_t messageSequenceNumber) [member function]
cls.add_method('SetMessageSequenceNumber',
'void',
[param('uint16_t', 'messageSequenceNumber')])
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::SetMessageType(ns3::olsr::MessageHeader::MessageType messageType) [member function]
cls.add_method('SetMessageType',
'void',
[param('ns3::olsr::MessageHeader::MessageType', 'messageType')])
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::SetOriginatorAddress(ns3::Ipv4Address originatorAddress) [member function]
cls.add_method('SetOriginatorAddress',
'void',
[param('ns3::Ipv4Address', 'originatorAddress')])
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::SetTimeToLive(uint8_t timeToLive) [member function]
cls.add_method('SetTimeToLive',
'void',
[param('uint8_t', 'timeToLive')])
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::SetVTime(ns3::Time time) [member function]
cls.add_method('SetVTime',
'void',
[param('ns3::Time', 'time')])
return
def register_Ns3OlsrMessageHeaderHello_methods(root_module, cls):
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::Hello() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::Hello(ns3::olsr::MessageHeader::Hello const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hello const &', 'arg0')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Hello::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h (module 'olsr'): ns3::Time ns3::olsr::MessageHeader::Hello::GetHTime() const [member function]
cls.add_method('GetHTime',
'ns3::Time',
[],
is_const=True)
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Hello::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Hello::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Hello::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Hello::SetHTime(ns3::Time time) [member function]
cls.add_method('SetHTime',
'void',
[param('ns3::Time', 'time')])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::hTime [variable]
cls.add_instance_attribute('hTime', 'uint8_t', is_const=False)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::linkMessages [variable]
cls.add_instance_attribute('linkMessages', 'std::vector< ns3::olsr::MessageHeader::Hello::LinkMessage >', is_const=False)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::willingness [variable]
cls.add_instance_attribute('willingness', 'uint8_t', is_const=False)
return
def register_Ns3OlsrMessageHeaderHelloLinkMessage_methods(root_module, cls):
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::LinkMessage::LinkMessage(ns3::olsr::MessageHeader::Hello::LinkMessage const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hello::LinkMessage const &', 'arg0')])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::LinkMessage::linkCode [variable]
cls.add_instance_attribute('linkCode', 'uint8_t', is_const=False)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hello::LinkMessage::neighborInterfaceAddresses [variable]
cls.add_instance_attribute('neighborInterfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False)
return
def register_Ns3OlsrMessageHeaderHna_methods(root_module, cls):
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Hna() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Hna(ns3::olsr::MessageHeader::Hna const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hna const &', 'arg0')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Hna::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Hna::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Hna::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Hna::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::associations [variable]
cls.add_instance_attribute('associations', 'std::vector< ns3::olsr::MessageHeader::Hna::Association >', is_const=False)
return
def register_Ns3OlsrMessageHeaderHnaAssociation_methods(root_module, cls):
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Association::Association() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Association::Association(ns3::olsr::MessageHeader::Hna::Association const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Hna::Association const &', 'arg0')])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Association::address [variable]
cls.add_instance_attribute('address', 'ns3::Ipv4Address', is_const=False)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Hna::Association::mask [variable]
cls.add_instance_attribute('mask', 'ns3::Ipv4Mask', is_const=False)
return
def register_Ns3OlsrMessageHeaderMid_methods(root_module, cls):
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Mid::Mid() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Mid::Mid(ns3::olsr::MessageHeader::Mid const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Mid const &', 'arg0')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Mid::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Mid::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Mid::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Mid::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Mid::interfaceAddresses [variable]
cls.add_instance_attribute('interfaceAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False)
return
def register_Ns3OlsrMessageHeaderTc_methods(root_module, cls):
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc::Tc() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc::Tc(ns3::olsr::MessageHeader::Tc const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MessageHeader::Tc const &', 'arg0')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Tc::Deserialize(ns3::Buffer::Iterator start, uint32_t messageSize) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start'), param('uint32_t', 'messageSize')])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::MessageHeader::Tc::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Tc::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::MessageHeader::Tc::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc::ansn [variable]
cls.add_instance_attribute('ansn', 'uint16_t', is_const=False)
## olsr-header.h (module 'olsr'): ns3::olsr::MessageHeader::Tc::neighborAddresses [variable]
cls.add_instance_attribute('neighborAddresses', 'std::vector< ns3::Ipv4Address >', is_const=False)
return
def register_Ns3OlsrMprSelectorTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
## olsr-repositories.h (module 'olsr'): ns3::olsr::MprSelectorTuple::MprSelectorTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::MprSelectorTuple::MprSelectorTuple(ns3::olsr::MprSelectorTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::MprSelectorTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::MprSelectorTuple::expirationTime [variable]
cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::MprSelectorTuple::mainAddr [variable]
cls.add_instance_attribute('mainAddr', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3OlsrNeighborTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_output_stream_operator()
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple::NeighborTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple::NeighborTuple(ns3::olsr::NeighborTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::NeighborTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple::neighborMainAddr [variable]
cls.add_instance_attribute('neighborMainAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple::status [variable]
cls.add_instance_attribute('status', 'ns3::olsr::NeighborTuple::Status', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::NeighborTuple::willingness [variable]
cls.add_instance_attribute('willingness', 'uint8_t', is_const=False)
return
def register_Ns3OlsrOlsrState_methods(root_module, cls):
## olsr-state.h (module 'olsr'): ns3::olsr::OlsrState::OlsrState(ns3::olsr::OlsrState const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::OlsrState const &', 'arg0')])
## olsr-state.h (module 'olsr'): ns3::olsr::OlsrState::OlsrState() [constructor]
cls.add_constructor([])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseAssociation(ns3::olsr::Association const & tuple) [member function]
cls.add_method('EraseAssociation',
'void',
[param('ns3::olsr::Association const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseAssociationTuple(ns3::olsr::AssociationTuple const & tuple) [member function]
cls.add_method('EraseAssociationTuple',
'void',
[param('ns3::olsr::AssociationTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseDuplicateTuple(ns3::olsr::DuplicateTuple const & tuple) [member function]
cls.add_method('EraseDuplicateTuple',
'void',
[param('ns3::olsr::DuplicateTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseIfaceAssocTuple(ns3::olsr::IfaceAssocTuple const & tuple) [member function]
cls.add_method('EraseIfaceAssocTuple',
'void',
[param('ns3::olsr::IfaceAssocTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseLinkTuple(ns3::olsr::LinkTuple const & tuple) [member function]
cls.add_method('EraseLinkTuple',
'void',
[param('ns3::olsr::LinkTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseMprSelectorTuple(ns3::olsr::MprSelectorTuple const & tuple) [member function]
cls.add_method('EraseMprSelectorTuple',
'void',
[param('ns3::olsr::MprSelectorTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseMprSelectorTuples(ns3::Ipv4Address const & mainAddr) [member function]
cls.add_method('EraseMprSelectorTuples',
'void',
[param('ns3::Ipv4Address const &', 'mainAddr')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseNeighborTuple(ns3::olsr::NeighborTuple const & neighborTuple) [member function]
cls.add_method('EraseNeighborTuple',
'void',
[param('ns3::olsr::NeighborTuple const &', 'neighborTuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseNeighborTuple(ns3::Ipv4Address const & mainAddr) [member function]
cls.add_method('EraseNeighborTuple',
'void',
[param('ns3::Ipv4Address const &', 'mainAddr')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseOlderTopologyTuples(ns3::Ipv4Address const & lastAddr, uint16_t ansn) [member function]
cls.add_method('EraseOlderTopologyTuples',
'void',
[param('ns3::Ipv4Address const &', 'lastAddr'), param('uint16_t', 'ansn')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseTopologyTuple(ns3::olsr::TopologyTuple const & tuple) [member function]
cls.add_method('EraseTopologyTuple',
'void',
[param('ns3::olsr::TopologyTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseTwoHopNeighborTuple(ns3::olsr::TwoHopNeighborTuple const & tuple) [member function]
cls.add_method('EraseTwoHopNeighborTuple',
'void',
[param('ns3::olsr::TwoHopNeighborTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseTwoHopNeighborTuples(ns3::Ipv4Address const & neighbor) [member function]
cls.add_method('EraseTwoHopNeighborTuples',
'void',
[param('ns3::Ipv4Address const &', 'neighbor')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::EraseTwoHopNeighborTuples(ns3::Ipv4Address const & neighbor, ns3::Ipv4Address const & twoHopNeighbor) [member function]
cls.add_method('EraseTwoHopNeighborTuples',
'void',
[param('ns3::Ipv4Address const &', 'neighbor'), param('ns3::Ipv4Address const &', 'twoHopNeighbor')])
## olsr-state.h (module 'olsr'): ns3::olsr::AssociationTuple * ns3::olsr::OlsrState::FindAssociationTuple(ns3::Ipv4Address const & gatewayAddr, ns3::Ipv4Address const & networkAddr, ns3::Ipv4Mask const & netmask) [member function]
cls.add_method('FindAssociationTuple',
'ns3::olsr::AssociationTuple *',
[param('ns3::Ipv4Address const &', 'gatewayAddr'), param('ns3::Ipv4Address const &', 'networkAddr'), param('ns3::Ipv4Mask const &', 'netmask')])
## olsr-state.h (module 'olsr'): ns3::olsr::DuplicateTuple * ns3::olsr::OlsrState::FindDuplicateTuple(ns3::Ipv4Address const & address, uint16_t sequenceNumber) [member function]
cls.add_method('FindDuplicateTuple',
'ns3::olsr::DuplicateTuple *',
[param('ns3::Ipv4Address const &', 'address'), param('uint16_t', 'sequenceNumber')])
## olsr-state.h (module 'olsr'): ns3::olsr::IfaceAssocTuple * ns3::olsr::OlsrState::FindIfaceAssocTuple(ns3::Ipv4Address const & ifaceAddr) [member function]
cls.add_method('FindIfaceAssocTuple',
'ns3::olsr::IfaceAssocTuple *',
[param('ns3::Ipv4Address const &', 'ifaceAddr')])
## olsr-state.h (module 'olsr'): ns3::olsr::IfaceAssocTuple const * ns3::olsr::OlsrState::FindIfaceAssocTuple(ns3::Ipv4Address const & ifaceAddr) const [member function]
cls.add_method('FindIfaceAssocTuple',
'ns3::olsr::IfaceAssocTuple const *',
[param('ns3::Ipv4Address const &', 'ifaceAddr')],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::LinkTuple * ns3::olsr::OlsrState::FindLinkTuple(ns3::Ipv4Address const & ifaceAddr) [member function]
cls.add_method('FindLinkTuple',
'ns3::olsr::LinkTuple *',
[param('ns3::Ipv4Address const &', 'ifaceAddr')])
## olsr-state.h (module 'olsr'): bool ns3::olsr::OlsrState::FindMprAddress(ns3::Ipv4Address const & address) [member function]
cls.add_method('FindMprAddress',
'bool',
[param('ns3::Ipv4Address const &', 'address')])
## olsr-state.h (module 'olsr'): ns3::olsr::MprSelectorTuple * ns3::olsr::OlsrState::FindMprSelectorTuple(ns3::Ipv4Address const & mainAddr) [member function]
cls.add_method('FindMprSelectorTuple',
'ns3::olsr::MprSelectorTuple *',
[param('ns3::Ipv4Address const &', 'mainAddr')])
## olsr-state.h (module 'olsr'): std::vector<ns3::Ipv4Address, std::allocator<ns3::Ipv4Address> > ns3::olsr::OlsrState::FindNeighborInterfaces(ns3::Ipv4Address const & neighborMainAddr) const [member function]
cls.add_method('FindNeighborInterfaces',
'std::vector< ns3::Ipv4Address >',
[param('ns3::Ipv4Address const &', 'neighborMainAddr')],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::NeighborTuple * ns3::olsr::OlsrState::FindNeighborTuple(ns3::Ipv4Address const & mainAddr) [member function]
cls.add_method('FindNeighborTuple',
'ns3::olsr::NeighborTuple *',
[param('ns3::Ipv4Address const &', 'mainAddr')])
## olsr-state.h (module 'olsr'): ns3::olsr::NeighborTuple * ns3::olsr::OlsrState::FindNeighborTuple(ns3::Ipv4Address const & mainAddr, uint8_t willingness) [member function]
cls.add_method('FindNeighborTuple',
'ns3::olsr::NeighborTuple *',
[param('ns3::Ipv4Address const &', 'mainAddr'), param('uint8_t', 'willingness')])
## olsr-state.h (module 'olsr'): ns3::olsr::TopologyTuple * ns3::olsr::OlsrState::FindNewerTopologyTuple(ns3::Ipv4Address const & lastAddr, uint16_t ansn) [member function]
cls.add_method('FindNewerTopologyTuple',
'ns3::olsr::TopologyTuple *',
[param('ns3::Ipv4Address const &', 'lastAddr'), param('uint16_t', 'ansn')])
## olsr-state.h (module 'olsr'): ns3::olsr::LinkTuple * ns3::olsr::OlsrState::FindSymLinkTuple(ns3::Ipv4Address const & ifaceAddr, ns3::Time time) [member function]
cls.add_method('FindSymLinkTuple',
'ns3::olsr::LinkTuple *',
[param('ns3::Ipv4Address const &', 'ifaceAddr'), param('ns3::Time', 'time')])
## olsr-state.h (module 'olsr'): ns3::olsr::NeighborTuple const * ns3::olsr::OlsrState::FindSymNeighborTuple(ns3::Ipv4Address const & mainAddr) const [member function]
cls.add_method('FindSymNeighborTuple',
'ns3::olsr::NeighborTuple const *',
[param('ns3::Ipv4Address const &', 'mainAddr')],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::TopologyTuple * ns3::olsr::OlsrState::FindTopologyTuple(ns3::Ipv4Address const & destAddr, ns3::Ipv4Address const & lastAddr) [member function]
cls.add_method('FindTopologyTuple',
'ns3::olsr::TopologyTuple *',
[param('ns3::Ipv4Address const &', 'destAddr'), param('ns3::Ipv4Address const &', 'lastAddr')])
## olsr-state.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple * ns3::olsr::OlsrState::FindTwoHopNeighborTuple(ns3::Ipv4Address const & neighbor, ns3::Ipv4Address const & twoHopNeighbor) [member function]
cls.add_method('FindTwoHopNeighborTuple',
'ns3::olsr::TwoHopNeighborTuple *',
[param('ns3::Ipv4Address const &', 'neighbor'), param('ns3::Ipv4Address const &', 'twoHopNeighbor')])
## olsr-state.h (module 'olsr'): ns3::olsr::AssociationSet const & ns3::olsr::OlsrState::GetAssociationSet() const [member function]
cls.add_method('GetAssociationSet',
'ns3::olsr::AssociationSet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::Associations const & ns3::olsr::OlsrState::GetAssociations() const [member function]
cls.add_method('GetAssociations',
'ns3::olsr::Associations const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::IfaceAssocSet const & ns3::olsr::OlsrState::GetIfaceAssocSet() const [member function]
cls.add_method('GetIfaceAssocSet',
'ns3::olsr::IfaceAssocSet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::IfaceAssocSet & ns3::olsr::OlsrState::GetIfaceAssocSetMutable() [member function]
cls.add_method('GetIfaceAssocSetMutable',
'ns3::olsr::IfaceAssocSet &',
[])
## olsr-state.h (module 'olsr'): ns3::olsr::LinkSet const & ns3::olsr::OlsrState::GetLinks() const [member function]
cls.add_method('GetLinks',
'ns3::olsr::LinkSet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::MprSelectorSet const & ns3::olsr::OlsrState::GetMprSelectors() const [member function]
cls.add_method('GetMprSelectors',
'ns3::olsr::MprSelectorSet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::MprSet ns3::olsr::OlsrState::GetMprSet() const [member function]
cls.add_method('GetMprSet',
'ns3::olsr::MprSet',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::NeighborSet const & ns3::olsr::OlsrState::GetNeighbors() const [member function]
cls.add_method('GetNeighbors',
'ns3::olsr::NeighborSet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::NeighborSet & ns3::olsr::OlsrState::GetNeighbors() [member function]
cls.add_method('GetNeighbors',
'ns3::olsr::NeighborSet &',
[])
## olsr-state.h (module 'olsr'): ns3::olsr::TopologySet const & ns3::olsr::OlsrState::GetTopologySet() const [member function]
cls.add_method('GetTopologySet',
'ns3::olsr::TopologySet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::TwoHopNeighborSet const & ns3::olsr::OlsrState::GetTwoHopNeighbors() const [member function]
cls.add_method('GetTwoHopNeighbors',
'ns3::olsr::TwoHopNeighborSet const &',
[],
is_const=True)
## olsr-state.h (module 'olsr'): ns3::olsr::TwoHopNeighborSet & ns3::olsr::OlsrState::GetTwoHopNeighbors() [member function]
cls.add_method('GetTwoHopNeighbors',
'ns3::olsr::TwoHopNeighborSet &',
[])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertAssociation(ns3::olsr::Association const & tuple) [member function]
cls.add_method('InsertAssociation',
'void',
[param('ns3::olsr::Association const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertAssociationTuple(ns3::olsr::AssociationTuple const & tuple) [member function]
cls.add_method('InsertAssociationTuple',
'void',
[param('ns3::olsr::AssociationTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertDuplicateTuple(ns3::olsr::DuplicateTuple const & tuple) [member function]
cls.add_method('InsertDuplicateTuple',
'void',
[param('ns3::olsr::DuplicateTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertIfaceAssocTuple(ns3::olsr::IfaceAssocTuple const & tuple) [member function]
cls.add_method('InsertIfaceAssocTuple',
'void',
[param('ns3::olsr::IfaceAssocTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): ns3::olsr::LinkTuple & ns3::olsr::OlsrState::InsertLinkTuple(ns3::olsr::LinkTuple const & tuple) [member function]
cls.add_method('InsertLinkTuple',
'ns3::olsr::LinkTuple &',
[param('ns3::olsr::LinkTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertMprSelectorTuple(ns3::olsr::MprSelectorTuple const & tuple) [member function]
cls.add_method('InsertMprSelectorTuple',
'void',
[param('ns3::olsr::MprSelectorTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertNeighborTuple(ns3::olsr::NeighborTuple const & tuple) [member function]
cls.add_method('InsertNeighborTuple',
'void',
[param('ns3::olsr::NeighborTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertTopologyTuple(ns3::olsr::TopologyTuple const & tuple) [member function]
cls.add_method('InsertTopologyTuple',
'void',
[param('ns3::olsr::TopologyTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::InsertTwoHopNeighborTuple(ns3::olsr::TwoHopNeighborTuple const & tuple) [member function]
cls.add_method('InsertTwoHopNeighborTuple',
'void',
[param('ns3::olsr::TwoHopNeighborTuple const &', 'tuple')])
## olsr-state.h (module 'olsr'): std::string ns3::olsr::OlsrState::PrintMprSelectorSet() const [member function]
cls.add_method('PrintMprSelectorSet',
'std::string',
[],
is_const=True)
## olsr-state.h (module 'olsr'): void ns3::olsr::OlsrState::SetMprSet(ns3::olsr::MprSet mprSet) [member function]
cls.add_method('SetMprSet',
'void',
[param('std::set< ns3::Ipv4Address >', 'mprSet')])
return
def register_Ns3OlsrPacketHeader_methods(root_module, cls):
cls.add_output_stream_operator()
## olsr-header.h (module 'olsr'): ns3::olsr::PacketHeader::PacketHeader(ns3::olsr::PacketHeader const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::PacketHeader const &', 'arg0')])
## olsr-header.h (module 'olsr'): ns3::olsr::PacketHeader::PacketHeader() [constructor]
cls.add_constructor([])
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::PacketHeader::Deserialize(ns3::Buffer::Iterator start) [member function]
cls.add_method('Deserialize',
'uint32_t',
[param('ns3::Buffer::Iterator', 'start')],
is_virtual=True)
## olsr-header.h (module 'olsr'): ns3::TypeId ns3::olsr::PacketHeader::GetInstanceTypeId() const [member function]
cls.add_method('GetInstanceTypeId',
'ns3::TypeId',
[],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): uint16_t ns3::olsr::PacketHeader::GetPacketLength() const [member function]
cls.add_method('GetPacketLength',
'uint16_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): uint16_t ns3::olsr::PacketHeader::GetPacketSequenceNumber() const [member function]
cls.add_method('GetPacketSequenceNumber',
'uint16_t',
[],
is_const=True)
## olsr-header.h (module 'olsr'): uint32_t ns3::olsr::PacketHeader::GetSerializedSize() const [member function]
cls.add_method('GetSerializedSize',
'uint32_t',
[],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): static ns3::TypeId ns3::olsr::PacketHeader::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::PacketHeader::Print(std::ostream & os) const [member function]
cls.add_method('Print',
'void',
[param('std::ostream &', 'os')],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::PacketHeader::Serialize(ns3::Buffer::Iterator start) const [member function]
cls.add_method('Serialize',
'void',
[param('ns3::Buffer::Iterator', 'start')],
is_const=True, is_virtual=True)
## olsr-header.h (module 'olsr'): void ns3::olsr::PacketHeader::SetPacketLength(uint16_t length) [member function]
cls.add_method('SetPacketLength',
'void',
[param('uint16_t', 'length')])
## olsr-header.h (module 'olsr'): void ns3::olsr::PacketHeader::SetPacketSequenceNumber(uint16_t seqnum) [member function]
cls.add_method('SetPacketSequenceNumber',
'void',
[param('uint16_t', 'seqnum')])
return
def register_Ns3OlsrRoutingProtocol_methods(root_module, cls):
## olsr-routing-protocol.h (module 'olsr'): static ns3::TypeId ns3::olsr::RoutingProtocol::GetTypeId() [member function]
cls.add_method('GetTypeId',
'ns3::TypeId',
[],
is_static=True)
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingProtocol::RoutingProtocol() [constructor]
cls.add_constructor([])
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::SetMainInterface(uint32_t interface) [member function]
cls.add_method('SetMainInterface',
'void',
[param('uint32_t', 'interface')])
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::Dump() [member function]
cls.add_method('Dump',
'void',
[])
## olsr-routing-protocol.h (module 'olsr'): std::vector<ns3::olsr::RoutingTableEntry, std::allocator<ns3::olsr::RoutingTableEntry> > ns3::olsr::RoutingProtocol::GetRoutingTableEntries() const [member function]
cls.add_method('GetRoutingTableEntries',
'std::vector< ns3::olsr::RoutingTableEntry >',
[],
is_const=True)
## olsr-routing-protocol.h (module 'olsr'): int64_t ns3::olsr::RoutingProtocol::AssignStreams(int64_t stream) [member function]
cls.add_method('AssignStreams',
'int64_t',
[param('int64_t', 'stream')])
## olsr-routing-protocol.h (module 'olsr'): std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > ns3::olsr::RoutingProtocol::GetInterfaceExclusions() const [member function]
cls.add_method('GetInterfaceExclusions',
'std::set< unsigned int >',
[],
is_const=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::SetInterfaceExclusions(std::set<unsigned int, std::less<unsigned int>, std::allocator<unsigned int> > exceptions) [member function]
cls.add_method('SetInterfaceExclusions',
'void',
[param('std::set< unsigned int >', 'exceptions')])
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::AddHostNetworkAssociation(ns3::Ipv4Address networkAddr, ns3::Ipv4Mask netmask) [member function]
cls.add_method('AddHostNetworkAssociation',
'void',
[param('ns3::Ipv4Address', 'networkAddr'), param('ns3::Ipv4Mask', 'netmask')])
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::RemoveHostNetworkAssociation(ns3::Ipv4Address networkAddr, ns3::Ipv4Mask netmask) [member function]
cls.add_method('RemoveHostNetworkAssociation',
'void',
[param('ns3::Ipv4Address', 'networkAddr'), param('ns3::Ipv4Mask', 'netmask')])
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::SetRoutingTableAssociation(ns3::Ptr<ns3::Ipv4StaticRouting> routingTable) [member function]
cls.add_method('SetRoutingTableAssociation',
'void',
[param('ns3::Ptr< ns3::Ipv4StaticRouting >', 'routingTable')])
## olsr-routing-protocol.h (module 'olsr'): ns3::Ptr<const ns3::Ipv4StaticRouting> ns3::olsr::RoutingProtocol::GetRoutingTableAssociation() const [member function]
cls.add_method('GetRoutingTableAssociation',
'ns3::Ptr< ns3::Ipv4StaticRouting const >',
[],
is_const=True)
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingProtocol::RoutingProtocol(ns3::olsr::RoutingProtocol const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::RoutingProtocol const &', 'arg0')])
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::DoInitialize() [member function]
cls.add_method('DoInitialize',
'void',
[],
visibility='protected', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): ns3::Ptr<ns3::Ipv4Route> ns3::olsr::RoutingProtocol::RouteOutput(ns3::Ptr<ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<ns3::NetDevice> oif, ns3::Socket::SocketErrno & sockerr) [member function]
cls.add_method('RouteOutput',
'ns3::Ptr< ns3::Ipv4Route >',
[param('ns3::Ptr< ns3::Packet >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice >', 'oif'), param('ns3::Socket::SocketErrno &', 'sockerr')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): bool ns3::olsr::RoutingProtocol::RouteInput(ns3::Ptr<const ns3::Packet> p, ns3::Ipv4Header const & header, ns3::Ptr<const ns3::NetDevice> idev, ns3::Ipv4RoutingProtocol::UnicastForwardCallback ucb, ns3::Ipv4RoutingProtocol::MulticastForwardCallback mcb, ns3::Ipv4RoutingProtocol::LocalDeliverCallback lcb, ns3::Ipv4RoutingProtocol::ErrorCallback ecb) [member function]
cls.add_method('RouteInput',
'bool',
[param('ns3::Ptr< ns3::Packet const >', 'p'), param('ns3::Ipv4Header const &', 'header'), param('ns3::Ptr< ns3::NetDevice const >', 'idev'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4Route >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ucb'), param('ns3::Callback< void, ns3::Ptr< ns3::Ipv4MulticastRoute >, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'mcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, unsigned int, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'lcb'), param('ns3::Callback< void, ns3::Ptr< ns3::Packet const >, ns3::Ipv4Header const &, ns3::Socket::SocketErrno, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty, ns3::empty >', 'ecb')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::NotifyInterfaceUp(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceUp',
'void',
[param('uint32_t', 'interface')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::NotifyInterfaceDown(uint32_t interface) [member function]
cls.add_method('NotifyInterfaceDown',
'void',
[param('uint32_t', 'interface')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::NotifyAddAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyAddAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::NotifyRemoveAddress(uint32_t interface, ns3::Ipv4InterfaceAddress address) [member function]
cls.add_method('NotifyRemoveAddress',
'void',
[param('uint32_t', 'interface'), param('ns3::Ipv4InterfaceAddress', 'address')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::SetIpv4(ns3::Ptr<ns3::Ipv4> ipv4) [member function]
cls.add_method('SetIpv4',
'void',
[param('ns3::Ptr< ns3::Ipv4 >', 'ipv4')],
visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::PrintRoutingTable(ns3::Ptr<ns3::OutputStreamWrapper> stream, ns3::Time::Unit unit=::ns3::Time::Unit::S) const [member function]
cls.add_method('PrintRoutingTable',
'void',
[param('ns3::Ptr< ns3::OutputStreamWrapper >', 'stream'), param('ns3::Time::Unit', 'unit', default_value='::ns3::Time::Unit::S')],
is_const=True, visibility='private', is_virtual=True)
## olsr-routing-protocol.h (module 'olsr'): void ns3::olsr::RoutingProtocol::DoDispose() [member function]
cls.add_method('DoDispose',
'void',
[],
visibility='private', is_virtual=True)
return
def register_Ns3OlsrRoutingTableEntry_methods(root_module, cls):
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry::RoutingTableEntry(ns3::olsr::RoutingTableEntry const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::RoutingTableEntry const &', 'arg0')])
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry::RoutingTableEntry() [constructor]
cls.add_constructor([])
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry::destAddr [variable]
cls.add_instance_attribute('destAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry::distance [variable]
cls.add_instance_attribute('distance', 'uint32_t', is_const=False)
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry::interface [variable]
cls.add_instance_attribute('interface', 'uint32_t', is_const=False)
## olsr-routing-protocol.h (module 'olsr'): ns3::olsr::RoutingTableEntry::nextAddr [variable]
cls.add_instance_attribute('nextAddr', 'ns3::Ipv4Address', is_const=False)
return
def register_Ns3OlsrTopologyTuple_methods(root_module, cls):
cls.add_binary_comparison_operator('==')
cls.add_output_stream_operator()
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple::TopologyTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple::TopologyTuple(ns3::olsr::TopologyTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::TopologyTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple::destAddr [variable]
cls.add_instance_attribute('destAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple::expirationTime [variable]
cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple::lastAddr [variable]
cls.add_instance_attribute('lastAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::TopologyTuple::sequenceNumber [variable]
cls.add_instance_attribute('sequenceNumber', 'uint16_t', is_const=False)
return
def register_Ns3OlsrTwoHopNeighborTuple_methods(root_module, cls):
cls.add_output_stream_operator()
cls.add_binary_comparison_operator('==')
## olsr-repositories.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple::TwoHopNeighborTuple() [constructor]
cls.add_constructor([])
## olsr-repositories.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple::TwoHopNeighborTuple(ns3::olsr::TwoHopNeighborTuple const & arg0) [constructor]
cls.add_constructor([param('ns3::olsr::TwoHopNeighborTuple const &', 'arg0')])
## olsr-repositories.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple::expirationTime [variable]
cls.add_instance_attribute('expirationTime', 'ns3::Time', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple::neighborMainAddr [variable]
cls.add_instance_attribute('neighborMainAddr', 'ns3::Ipv4Address', is_const=False)
## olsr-repositories.h (module 'olsr'): ns3::olsr::TwoHopNeighborTuple::twoHopNeighborAddr [variable]
cls.add_instance_attribute('twoHopNeighborAddr', 'ns3::Ipv4Address', is_const=False)
return
def register_functions(root_module):
module = root_module
register_functions_ns3_FatalImpl(module.add_cpp_namespace('FatalImpl'), root_module)
register_functions_ns3_Hash(module.add_cpp_namespace('Hash'), root_module)
register_functions_ns3_TracedValueCallback(module.add_cpp_namespace('TracedValueCallback'), root_module)
register_functions_ns3_olsr(module.add_cpp_namespace('olsr'), root_module)
register_functions_ns3_tests(module.add_cpp_namespace('tests'), root_module)
return
def register_functions_ns3_FatalImpl(module, root_module):
return
def register_functions_ns3_Hash(module, root_module):
register_functions_ns3_Hash_Function(module.add_cpp_namespace('Function'), root_module)
return
def register_functions_ns3_Hash_Function(module, root_module):
return
def register_functions_ns3_TracedValueCallback(module, root_module):
return
def register_functions_ns3_olsr(module, root_module):
## olsr-header.h (module 'olsr'): double ns3::olsr::EmfToSeconds(uint8_t emf) [free function]
module.add_function('EmfToSeconds',
'double',
[param('uint8_t', 'emf')])
## olsr-header.h (module 'olsr'): uint8_t ns3::olsr::SecondsToEmf(double seconds) [free function]
module.add_function('SecondsToEmf',
'uint8_t',
[param('double', 'seconds')])
return
def register_functions_ns3_tests(module, root_module):
return
def main():
out = FileCodeSink(sys.stdout)
root_module = module_init()
register_types(root_module)
register_methods(root_module)
register_functions(root_module)
root_module.generate(out)
if __name__ == '__main__':
main()<|fim▁end|> | register_Ns3SimpleRefCount__Ns3EventImpl_Ns3Empty_Ns3DefaultDeleter__lt__ns3EventImpl__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::EventImpl, ns3::empty, ns3::DefaultDeleter<ns3::EventImpl> >'])
register_Ns3SimpleRefCount__Ns3HashImplementation_Ns3Empty_Ns3DefaultDeleter__lt__ns3HashImplementation__gt___methods(root_module, root_module['ns3::SimpleRefCount< ns3::Hash::Implementation, ns3::empty, ns3::DefaultDeleter<ns3::Hash::Implementation> >']) |
<|file_name|>testclient.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
import socket
import sys
<|fim▁hole|>sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
# Connect to server and send data
print "Connected to ", HOST, ":", PORT, "\n","Awaiting input\n"
data = sys.stdin.readline()
sock.connect((HOST, PORT))
print "Connected to ", HOST, ":", PORT, "\n","Awaiting input\n"
exit = False
while exit != True:
sock.sendall(data + "\n")
if data.strip() == 'bye':
exit = True
received = sock.recv(1024)
print "Sent: " , data
print "Received: " , received
data = sys.stdin.readline()
# Receive data from the server and shut down
finally:
sock.close()<|fim▁end|> | HOST, PORT = "24.21.106.140", 8080
# Create a socket (SOCK_STREAM means a TCP socket) |
<|file_name|>lonely-pixel-ii.py<|end_file_name|><|fim▁begin|># Time: O(m * n)
# Space: O(m * n)
import collections
class Solution(object):
def findBlackPixel(self, picture, N):
"""
:type picture: List[List[str]]
:type N: int
:rtype: int
"""
rows, cols = [0] * len(picture), [0] * len(picture[0])
lookup = collections.defaultdict(int)
for i in xrange(len(picture)):
for j in xrange(len(picture[0])):
if picture[i][j] == 'B':
rows[i] += 1
cols[j] += 1
lookup[tuple(picture[i])] += 1
result = 0
for i in xrange(len(picture)):
if rows[i] == N and lookup[tuple(picture[i])] == N:
for j in xrange(len(picture[0])):
result += picture[i][j] == 'B' and cols[j] == N
return result
class Solution2(object):
def findBlackPixel(self, picture, N):
"""
:type picture: List[List[str]]
:type N: int
:rtype: int
"""<|fim▁hole|> if cnt == N == row.count('B'))<|fim▁end|> | lookup = collections.Counter(map(tuple, picture))
cols = [col.count('B') for col in zip(*picture)]
return sum(N * zip(row, cols).count(('B', N)) \
for row, cnt in lookup.iteritems() \ |
<|file_name|>OrderItemDetailsSummary.tsx<|end_file_name|><|fim▁begin|>import React from 'react';
import { connect } from 'react-redux';
import { getFormValues, isValid } from 'redux-form';
import { OfferingLogo } from '@waldur/marketplace/common/OfferingLogo';
import { FORM_ID } from '@waldur/marketplace/details/constants';
import { SummaryTable } from '@waldur/marketplace/details/OrderSummary';
import { pricesSelector } from '@waldur/marketplace/details/plan/utils';
import {
OrderSummaryProps,
OfferingFormData,
} from '@waldur/marketplace/details/types';
import { Offering } from '@waldur/marketplace/types';
import { isVisible } from '@waldur/store/config';
import { getCustomer, getProject } from '@waldur/workspace/selectors';
import { Customer, Project } from '@waldur/workspace/types';
const PureOrderItemDetailsSummary: React.FC<OrderSummaryProps> = (
props: OrderSummaryProps,
) => (
<>
<OfferingLogo src={props.offering.thumbnail} size="small" />
<SummaryTable {...props} /><|fim▁hole|>);
interface OrderItemDetailsSummary {
customer: Customer;
project?: Project;
total: number;
formData: OfferingFormData;
formValid: boolean;
}
const mapStateToProps = (state, ownProps) => ({
customer: getCustomer(state),
project: getProject(state),
total: pricesSelector(state, ownProps).total,
formData: getFormValues(FORM_ID)(state),
formValid: isValid(FORM_ID)(state),
shouldConcealPrices: isVisible(state, 'marketplace.conceal_prices'),
});
export const OrderItemDetailsSummary = connect<
OrderItemDetailsSummary,
{},
{ offering: Offering }
>(mapStateToProps)(PureOrderItemDetailsSummary);<|fim▁end|> | </> |
<|file_name|>main.rs<|end_file_name|><|fim▁begin|>//Test File gtk_test
extern crate gtk;
//Custom mods
mod system_io;
mod gtk_converter;
pub mod m_config;
//Os interaction
use std::process::Command;
use std::process::ChildStdout;<|fim▁hole|>
use gtk::Builder;
use gtk::prelude::*;
// make moving clones into closures more convenient
//shameless copied from the examples
macro_rules! clone {
(@param _) => ( _ );
(@param $x:ident) => ( $x );
($($n:ident),+ => move || $body:expr) => (
{
$( let $n = $n.clone(); )+
move || $body
}
);
($($n:ident),+ => move |$($p:tt),+| $body:expr) => (
{
$( let $n = $n.clone(); )+
move |$(clone!(@param $p),)+| $body
}
);
}
fn execute_command(location: &String, command: &String, arguments: &String){
Command::new("xterm")
.arg("-hold")
.arg("-e")
.arg("cd ".to_string() + location + " && " + command + " " + arguments)
.spawn()
.expect("Failed to run command");
}
fn convert_to_str(x: &str) -> &str{
x
}
fn main() {
if gtk::init().is_err() {
println!("Failed to initialize GTK.");
return;
}
let glade_src = include_str!("shipload.glade");
let builder = Builder::new();
builder.add_from_string(glade_src).unwrap();
//**********************************************
//Crucial
let configuration = m_config::create_config();
//Main
//Get Window
let window: gtk::Window = builder.get_object("window").unwrap();
//Close Button
let close_button: gtk::Button = builder.get_object("B_Close").unwrap();
//Set Header bar information
let header: gtk::HeaderBar = builder.get_object("Header").unwrap();
let pref_window: gtk::Window = builder.get_object("W_Preferences").unwrap();
let pref_button: gtk::Button = builder.get_object("B_Preferences").unwrap();
let pref_close: gtk::Button = builder.get_object("Pref_Close").unwrap();
let pref_save: gtk::Button = builder.get_object("Pref_Save").unwrap();
//Cargo
let cargo_build: gtk::Button = builder.get_object("B_Cargo_Build").unwrap();
let cargo_build_folder: gtk::FileChooserButton = builder.get_object("Cargo_Build_FolderChooser").unwrap();
let cargo_build_arguments: gtk::Entry = builder.get_object("Cargo_Build_ExtraOptions_Entry").unwrap();
let cargo_run_run: gtk::Button = builder.get_object("B_Cargo_Run").unwrap();
let cargo_run_arguments: gtk::Entry = builder.get_object("Cargo_Run_ExtraOptions_Entry").unwrap();
//RustUp
let ru_install_Button: gtk::Button = builder.get_object("B_NT_Install").unwrap();
let ru_install_channel: gtk::ComboBoxText = builder.get_object("RU_New_Channel").unwrap();
let ru_activate_channel_chooser: gtk::ComboBoxText = builder.get_object("RU_Active_Channel").unwrap();
let ru_activate_channel_button: gtk::Button = builder.get_object("B_NT_Activate").unwrap();
let ru_update_button: gtk::Button = builder.get_object("B_RU_Update").unwrap();
//Crates.io
let text_buffer: gtk::TextBuffer = builder.get_object("CratesTextBuffer").unwrap();
let search_button: gtk::Button = builder.get_object("CratesSearch").unwrap();
let search_entry: gtk::Entry = builder.get_object("CratesSearch_Entry").unwrap();
let level_bar: gtk::LevelBar = builder.get_object("SearchLevel").unwrap();
//**********************************************
//Main
header.set_title("Teddy");
header.set_subtitle("Rolf");
//Close event
close_button.connect_clicked(move |_| {
println!("Closing normal!");
gtk::main_quit();
Inhibit(false);
});
//Window Close event
window.connect_delete_event(|_,_| {
gtk::main_quit();
Inhibit(false)
});
//Preferences show event
pref_button.connect_clicked(clone!(pref_window => move |_| {
pref_window.show_all();
}));
//Hide, without save
pref_close.connect_clicked(clone!(pref_window => move |_| {
pref_window.hide();
}));
//Hide, with save
pref_save.connect_clicked(clone!(pref_window => move |_| {
pref_window.hide();
}));
//Cargo
cargo_build.connect_clicked(clone!(cargo_build_folder, cargo_build_arguments => move |_|{
let argument_string: String = gtk_converter::text_from_entry(&cargo_build_arguments);
let locationstr: String = gtk_converter::path_from_filechooser(&cargo_build_folder);
execute_command(&locationstr, &"cargo build".to_string(), &argument_string.to_string());
}));
cargo_run_run.connect_clicked(clone!(cargo_run_arguments, cargo_build_folder => move |_|{
let argument_string: String = gtk_converter::text_from_entry(&cargo_run_arguments);
let locationstr: String = gtk_converter::path_from_filechooser(&cargo_build_folder);
system_io::execute_command(&locationstr, &"cargo run".to_string(), &argument_string.to_string());
}));
//RustUp
//Install new toolchain
ru_install_Button.connect_clicked(clone!(ru_install_channel => move |_| {
//Sort output
let entry = ru_install_channel.get_active_text();
let mut to_install: String =String::from("NoContent");
match entry {
Some(e) => to_install = e,
None => {}
}
//Join install command/argument
let execute_string: String = String::from("toolchain install ") + to_install.as_str();
//INstall
system_io::execute_command(&String::from("~/"), &String::from("rustup"), &execute_string);
println!("Installed: {}", to_install);
}));
//Activate channel
ru_activate_channel_button.connect_clicked(clone!(ru_activate_channel_chooser => move |_|{
//Sort output
let entry = ru_install_channel.get_active_text();
let mut to_activate: String =String::from("NoContent");
match entry {
Some(e) => to_activate = e,
None => {}
}
let activate_arg: String = String::from("default ") + to_activate.as_str();
system_io::execute_command(&String::from("~/"), &String::from("rustup"), &activate_arg);
}));
//Update everything
ru_update_button.connect_clicked(|_| {
system_io::execute_command(&String::from("~/"), &String::from("rustup"), &String::from("update"));
});
//Crates.io
search_button.connect_clicked(clone!(text_buffer, search_entry => move |_| {
let entry: String = gtk_converter::text_from_entry(&search_entry);
while level_bar.get_value() != 0.2 {
level_bar.set_value(0.2);
}
println!("Outside: {}", entry);
level_bar.set_value(0.5);
let output = Command::new("cargo").arg("search")
.arg(entry)
.arg("--limit")
.arg("40")
.output()
.expect("Failed to ls");
let out: String = String::from_utf8(output.stdout).expect("Not UTF-8");
level_bar.set_value(0.75);
let last: &str = convert_to_str(&out);
text_buffer.set_text(last);
level_bar.set_value(1.0);
}));
window.show_all();
gtk::main();
}<|fim▁end|> |
use std::io;
use std::io::prelude::*; |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
from django.contrib.auth.models import User
from django.contrib.sites.models import Site
from django.utils.translation import ugettext_lazy as _
from press_links.enums import STATUS_CHOICES, LIVE_STATUS, DRAFT_STATUS
from django.utils import timezone
from parler.models import TranslatableModel, TranslatedFields
from parler.managers import TranslatableQuerySet
class EntryManager(models.Manager):
def get_queryset(self):
return EntryQuerySet(self.model)
def live(self):
"""
Returns a list of all published entries.
:rtype: django.db.models.QuerySet
"""
return self.filter(pub_date__lte=timezone.now(), status=LIVE_STATUS) \
.filter(site=Site.objects.get_current())
class EntryQuerySet(TranslatableQuerySet):
pass
class Entry(TranslatableModel):
author = models.ForeignKey(User, verbose_name=_('author'),
related_name='%(app_label)s_%(class)s_related')
slug = models.SlugField(max_length=255, unique_for_date='pub_date',
verbose_name='slug')
pub_date = models.DateTimeField(default=timezone.now,
verbose_name=_('publication date'))
status = models.IntegerField(choices=STATUS_CHOICES, default=DRAFT_STATUS,
verbose_name=_('status'))
site = models.ManyToManyField(Site,
verbose_name=_('Sites where the entry is published'),
related_name='%(app_label)s_%(class)s_related')
objects = EntryManager()
translations = TranslatedFields(
title=models.CharField(max_length=255, verbose_name=_('title')),
source=models.CharField(max_length=255, blank=True,
verbose_name=_('the source for the entry')),
excerpt=models.TextField(blank=True, verbose_name=_(u'Excerpt'))
)
@models.permalink
def get_absolute_url(self):
return ('press_links_entry_detail', (), {'slug': self.slug})
class Meta:
get_latest_by = 'pub_date'
ordering = ['-pub_date']
verbose_name = _('Press Entry')
verbose_name_plural = _('Press Entries')
def __unicode__(self):
return self.title
class Link(TranslatableModel):
link_new_page = models.BooleanField(default=False, verbose_name=_('open link in new page'))
entry = models.ForeignKey(Entry, verbose_name=_('Entry'))
translations = TranslatedFields(
link=models.CharField(max_length=255,
verbose_name=_('link address (add http:// for external link)')),
link_text=models.CharField(max_length=255,
verbose_name=_('text for link'))
)
class Meta:<|fim▁hole|><|fim▁end|> | verbose_name = _('Press Link')
verbose_name_plural = _('Press Links') |
<|file_name|>MainTestKMeans_saveToFile.java<|end_file_name|><|fim▁begin|>package ca.pfv.spmf.test;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import ca.pfv.spmf.algorithms.clustering.kmeans.AlgoKMeans;
/**
* Example of how to use the KMEans algorithm, in source code.
*/
public class MainTestKMeans_saveToFile {
public static void main(String []args) throws NumberFormatException, IOException{<|fim▁hole|> String input = fileToPath("configKmeans.txt");
String output = "d://output.txt";
int k=4;
// Apply the algorithm
AlgoKMeans algoKMeans = new AlgoKMeans(); // we request 3 clusters
algoKMeans.runAlgorithm(input, k);
algoKMeans.printStatistics();
algoKMeans.saveToFile(output);
}
public static String fileToPath(String filename) throws UnsupportedEncodingException{
URL url = MainTestKMeans_saveToFile.class.getResource(filename);
return java.net.URLDecoder.decode(url.getPath(),"UTF-8");
}
}<|fim▁end|> | |
<|file_name|>pinsrb.rs<|end_file_name|><|fim▁begin|>use ::{BroadcastMode, Instruction, MaskReg, MergeMode, Mnemonic, OperandSize, Reg, RoundingMode};
use ::RegType::*;
use ::instruction_def::*;
use ::Operand::*;
use ::Reg::*;
use ::RegScale::*;<|fim▁hole|>
fn pinsrb_1() {
run_test(&Instruction { mnemonic: Mnemonic::PINSRB, operand1: Some(Direct(XMM6)), operand2: Some(Direct(EBP)), operand3: Some(Literal8(106)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 58, 32, 245, 106], OperandSize::Dword)
}
fn pinsrb_2() {
run_test(&Instruction { mnemonic: Mnemonic::PINSRB, operand1: Some(Direct(XMM5)), operand2: Some(IndirectScaledDisplaced(ESI, Two, 1749524261, Some(OperandSize::Byte), None)), operand3: Some(Literal8(109)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 58, 32, 44, 117, 37, 159, 71, 104, 109], OperandSize::Dword)
}
fn pinsrb_3() {
run_test(&Instruction { mnemonic: Mnemonic::PINSRB, operand1: Some(Direct(XMM5)), operand2: Some(Direct(EDI)), operand3: Some(Literal8(12)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 58, 32, 239, 12], OperandSize::Qword)
}
fn pinsrb_4() {
run_test(&Instruction { mnemonic: Mnemonic::PINSRB, operand1: Some(Direct(XMM0)), operand2: Some(IndirectScaledDisplaced(RDI, Four, 1269005607, Some(OperandSize::Byte), None)), operand3: Some(Literal8(38)), operand4: None, lock: false, rounding_mode: None, merge_mode: None, sae: false, mask: None, broadcast: None }, &[102, 15, 58, 32, 4, 189, 39, 125, 163, 75, 38], OperandSize::Qword)
}<|fim▁end|> | |
<|file_name|>urls.py<|end_file_name|><|fim▁begin|># Copyright 2010 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
from django.conf.urls import patterns, url
from piston.authentication import HttpBasicAuthentication
from piston.resource import Resource
from identityprovider.auth import (
basic_authenticate,
SSOOAuthAuthentication,
)
import api.v10.handlers as v10
import api.v11.handlers as v11
import api.v20.handlers as v20
from api.v20.utils import ApiOAuthAuthentication
v10root = Resource(handler=v10.RootHandler)
v10captcha = Resource(handler=v10.CaptchaHandler)
v10registration = Resource(handler=v10.RegistrationHandler)
v10auth = Resource(
handler=v10.AuthenticationHandler,
authentication=HttpBasicAuthentication(auth_func=basic_authenticate)
)
v10accounts = Resource(<|fim▁hole|> authentication=SSOOAuthAuthentication()
)
v11root = Resource(handler=v11.RootHandler)
v11auth = Resource(
handler=v11.AuthenticationHandler,
authentication=HttpBasicAuthentication(auth_func=basic_authenticate)
)
v2accounts = Resource(
handler=v20.AccountsHandler, authentication=ApiOAuthAuthentication())
v2emails = Resource(handler=v20.EmailsHandler)
v2login = Resource(handler=v20.AccountLoginHandler)
v2login_phone = Resource(handler=v20.AccountPhoneLoginHandler)
v2registration = Resource(handler=v20.AccountRegistrationHandler)
v2requests = Resource(handler=v20.RequestsHandler)
v2password_reset = Resource(handler=v20.PasswordResetTokenHandler)
urlpatterns = patterns(
'',
# v1.0
url(r'^1.0/$', v10root, name='api-10-root',
kwargs={'emitter_format': 'lazr.restful'}),
url(r'^1.0/captchas$', v10captcha, name='api-10-captchas',
kwargs={'emitter_format': 'lazr.restful'}),
url(r'^1.0/registration$', v10registration, name='api-10-registration',
kwargs={'emitter_format': 'lazr.restful'}),
url(r'^1.0/authentications$', v10auth, name='api-10-authentications',
kwargs={'emitter_format': 'lazr.restful'}),
url(r'^1.0/accounts$', v10accounts, name='api-10-accounts',
kwargs={'emitter_format': 'lazr.restful'}),
# v1.1
url(r'^1.1/$', v11root,
kwargs={'emitter_format': 'lazr.restful'}),
# add backwards compatible endpoints
url(r'^1.1/captchas$', v10captcha,
kwargs={'emitter_format': 'lazr.restful'}),
url(r'^1.1/registration$', v10registration,
kwargs={'emitter_format': 'lazr.restful'}),
url(r'^1.1/accounts$', v10accounts,
kwargs={'emitter_format': 'lazr.restful'}),
# add overriding endpoints
url(r'^1.1/authentications$', v11auth,
kwargs={'emitter_format': 'lazr.restful'}),
# v2
url(r'^v2/accounts$', v2registration, name='api-registration'),
url(r'^v2/tokens/oauth$', v2login, name='api-login'),
url(r'^v2/tokens/password$', v2password_reset, name='api-password-reset'),
url(r'^v2/accounts/(\w+)$', v2accounts, name='api-account'),
url(r'^v2/requests/validate$', v2requests, name='api-requests'),
# login from phone, with a phone user id
url(r'^v2/tokens/phone$', v2login_phone, name='api-login-phone'),
# temporarily hooked up so we can do reverse()
url(r'^v2/emails/(.*)$', v2emails, name='api-email'),
url(r'^v2/tokens/oauth/(.*)$', v2login, name='api-token'),
url(r'^v2/tokens/password/(.*)$', v2password_reset,
name='api-password-reset'),
)<|fim▁end|> | handler=v10.AccountsHandler, |
<|file_name|>set_watch_mode.rs<|end_file_name|><|fim▁begin|>use std::io;
use super::super::{WriteTo, WatchMode, WatchModeReader, WriteResult, Reader, ReaderStatus, MessageInner, Message};
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct SetWatchMode {
mode: WatchMode,
}
#[derive(Debug)]
pub struct SetWatchModeReader {
inner: WatchModeReader,
}
impl SetWatchMode {
pub fn new(mode: WatchMode) -> Self {
SetWatchMode { mode }
}
pub fn mode(&self) -> WatchMode {
self.mode
}
pub fn reader() -> SetWatchModeReader {
SetWatchModeReader { inner: WatchMode::reader() }
}
}
impl MessageInner for SetWatchMode {
#[inline]
fn wrap(self) -> Message {
Message::SetWatchMode(self)
}
}
<|fim▁hole|>
Ok(status.map(|mode| SetWatchMode::new(mode)))
}
fn rewind(&mut self) {
self.inner.rewind();
}
}
impl WriteTo for SetWatchMode {
fn write_to<W: io::Write>(&self, target: &mut W) -> WriteResult {
self.mode.write_to(target)
}
}
#[cfg(test)]
mod test {
use super::*;
use super::super::super::{MessageType, WatchMode};
#[test]
fn test_reader_with_tagged() {
let input = vec![
/* type */ MessageType::SetWatchMode.into(),
/* mode = tagged */ 2,
/* tag */ 0, 0, 0, 0, 0, 0, 255, 255
];
test_reader! {
Message::reader(),
input,
ReaderStatus::Pending,
ReaderStatus::Pending,
ReaderStatus::Pending,
ReaderStatus::Complete(Message::SetWatchMode(SetWatchMode::new(WatchMode::Tagged(65535))))
};
}
#[test]
fn test_reader() {
let input = vec![
/* type */ MessageType::SetWatchMode.into(),
/* mode = all */ 1
];
test_reader! {
Message::reader(),
input,
ReaderStatus::Pending,
ReaderStatus::Pending,
ReaderStatus::Complete(Message::SetWatchMode(SetWatchMode::new(WatchMode::All)))
};
}
}<|fim▁end|> | impl Reader<SetWatchMode> for SetWatchModeReader {
fn resume<R>(&mut self, input: &mut R) -> io::Result<ReaderStatus<SetWatchMode>> where R: io::Read {
let status = self.inner.resume(input)?; |
<|file_name|>export_test.go<|end_file_name|><|fim▁begin|>package s3
import (
"github.com/djbarber/ipfs-hack/Godeps/_workspace/src/github.com/crowdmob/goamz/aws"
)
var originalStrategy = attempts
func SetAttemptStrategy(s *aws.AttemptStrategy) {
if s == nil {
attempts = originalStrategy
} else {
attempts = *s
}
}
func Sign(auth aws.Auth, method, path string, params, headers map[string][]string) {
sign(auth, method, path, params, headers)
}
func SetListPartsMax(n int) {<|fim▁hole|>
func SetListMultiMax(n int) {
listMultiMax = n
}<|fim▁end|> | listPartsMax = n
} |
<|file_name|>test_binary_sensor.py<|end_file_name|><|fim▁begin|>"""The test for the bayesian sensor platform."""
import json
import unittest
from homeassistant.components.bayesian import binary_sensor as bayesian
from homeassistant.components.homeassistant import (
DOMAIN as HA_DOMAIN,
SERVICE_UPDATE_ENTITY,
)
from homeassistant.const import ATTR_ENTITY_ID, STATE_UNKNOWN
from homeassistant.setup import async_setup_component, setup_component
from tests.common import get_test_home_assistant
class TestBayesianBinarySensor(unittest.TestCase):
"""Test the threshold sensor."""
def setup_method(self, method):
"""Set up things to be run when tests are started."""
self.hass = get_test_home_assistant()
def teardown_method(self, method):
"""Stop everything that was started."""
self.hass.stop()
def test_load_values_when_added_to_hass(self):
"""Test that sensor initializes with observations of relevant entities."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "off",
"prob_given_true": 0.8,
"prob_given_false": 0.4,
}
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.attributes.get("observations")[0]["prob_given_true"] == 0.8
assert state.attributes.get("observations")[0]["prob_given_false"] == 0.4
def test_unknown_state_does_not_influence_probability(self):
"""Test that an unknown state does not change the output probability."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "off",
"prob_given_true": 0.8,
"prob_given_false": 0.4,
}
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
self.hass.states.set("sensor.test_monitored", STATE_UNKNOWN)
self.hass.block_till_done()
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.attributes.get("observations") == []
def test_sensor_numeric_state(self):
"""Test sensor on numeric state platform observations."""
config = {
"binary_sensor": {
"platform": "bayesian",
"name": "Test_Binary",
"observations": [
{
"platform": "numeric_state",
"entity_id": "sensor.test_monitored",
"below": 10,
"above": 5,
"prob_given_true": 0.6,
},
{
"platform": "numeric_state",
"entity_id": "sensor.test_monitored1",
"below": 7,
"above": 5,
"prob_given_true": 0.9,
"prob_given_false": 0.1,
},
],
"prior": 0.2,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", 4)
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert [] == state.attributes.get("observations")
assert 0.2 == state.attributes.get("probability")
assert state.state == "off"
self.hass.states.set("sensor.test_monitored", 6)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", 4)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", 6)
self.hass.states.set("sensor.test_monitored1", 6)
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.attributes.get("observations")[0]["prob_given_true"] == 0.6
assert state.attributes.get("observations")[1]["prob_given_true"] == 0.9
assert state.attributes.get("observations")[1]["prob_given_false"] == 0.1
assert round(abs(0.77 - state.attributes.get("probability")), 7) == 0
assert state.state == "on"
self.hass.states.set("sensor.test_monitored", 6)
self.hass.states.set("sensor.test_monitored1", 0)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", 4)
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert 0.2 == state.attributes.get("probability")
assert state.state == "off"
self.hass.states.set("sensor.test_monitored", 15)
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.state == "off"
def test_sensor_state(self):
"""Test sensor on state platform observations."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "off",
"prob_given_true": 0.8,
"prob_given_false": 0.4,
}
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
state = self.hass.states.get("binary_sensor.test_binary")
assert [] == state.attributes.get("observations")
assert 0.2 == state.attributes.get("probability")
assert state.state == "off"
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.attributes.get("observations")[0]["prob_given_true"] == 0.8
assert state.attributes.get("observations")[0]["prob_given_false"] == 0.4
assert round(abs(0.33 - state.attributes.get("probability")), 7) == 0
assert state.state == "on"
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert round(abs(0.2 - state.attributes.get("probability")), 7) == 0
assert state.state == "off"
def test_sensor_value_template(self):
"""Test sensor on template platform observations."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "template",
"value_template": "{{states('sensor.test_monitored') == 'off'}}",
"prob_given_true": 0.8,
"prob_given_false": 0.4,
}
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
state = self.hass.states.get("binary_sensor.test_binary")
assert [] == state.attributes.get("observations")
assert 0.2 == state.attributes.get("probability")
assert state.state == "off"
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.attributes.get("observations")[0]["prob_given_true"] == 0.8
assert state.attributes.get("observations")[0]["prob_given_false"] == 0.4
assert round(abs(0.33 - state.attributes.get("probability")), 7) == 0
assert state.state == "on"
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert round(abs(0.2 - state.attributes.get("probability")), 7) == 0
assert state.state == "off"
def test_threshold(self):
"""Test sensor on probability threshold limits."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "on",
"prob_given_true": 1.0,
}
],
"prior": 0.5,
"probability_threshold": 1.0,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert round(abs(1.0 - state.attributes.get("probability")), 7) == 0
assert state.state == "on"
def test_multiple_observations(self):
"""Test sensor with multiple observations of same entity."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "blue",
"prob_given_true": 0.8,
"prob_given_false": 0.4,
},
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "red",
"prob_given_true": 0.2,
"prob_given_false": 0.4,
},
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "off")
state = self.hass.states.get("binary_sensor.test_binary")
for key, attrs in state.attributes.items():
json.dumps(attrs)
assert [] == state.attributes.get("observations")
assert 0.2 == state.attributes.get("probability")
assert state.state == "off"
self.hass.states.set("sensor.test_monitored", "blue")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "blue")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert state.attributes.get("observations")[0]["prob_given_true"] == 0.8
assert state.attributes.get("observations")[0]["prob_given_false"] == 0.4
assert round(abs(0.33 - state.attributes.get("probability")), 7) == 0
assert state.state == "on"
self.hass.states.set("sensor.test_monitored", "blue")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "red")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert round(abs(0.11 - state.attributes.get("probability")), 7) == 0
assert state.state == "off"
def test_probability_updates(self):
"""Test probability update function."""
prob_given_true = [0.3, 0.6, 0.8]
prob_given_false = [0.7, 0.4, 0.2]
prior = 0.5
for pt, pf in zip(prob_given_true, prob_given_false):
prior = bayesian.update_probability(prior, pt, pf)
assert round(abs(0.720000 - prior), 7) == 0
prob_given_true = [0.8, 0.3, 0.9]
prob_given_false = [0.6, 0.4, 0.2]
prior = 0.7
for pt, pf in zip(prob_given_true, prob_given_false):
prior = bayesian.update_probability(prior, pt, pf)
assert round(abs(0.9130434782608695 - prior), 7) == 0
def test_observed_entities(self):
"""Test sensor on observed entities."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "off",
"prob_given_true": 0.9,
"prob_given_false": 0.4,
},
{
"platform": "template",
"value_template": "{{is_state('sensor.test_monitored1','on') and is_state('sensor.test_monitored','off')}}",
"prob_given_true": 0.9,
},
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored1", "off")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert [] == state.attributes.get("occurred_observation_entities")
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert ["sensor.test_monitored"] == state.attributes.get(
"occurred_observation_entities"
)
self.hass.states.set("sensor.test_monitored1", "on")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert ["sensor.test_monitored", "sensor.test_monitored1"] == sorted(
state.attributes.get("occurred_observation_entities")
)
def test_state_attributes_are_serializable(self):
"""Test sensor on observed entities."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "off",
"prob_given_true": 0.9,
"prob_given_false": 0.4,
},
{
"platform": "template",
"value_template": "{{is_state('sensor.test_monitored1','on') and is_state('sensor.test_monitored','off')}}",
"prob_given_true": 0.9,
},
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
assert setup_component(self.hass, "binary_sensor", config)
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored", "on")
self.hass.block_till_done()
self.hass.states.set("sensor.test_monitored1", "off")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert [] == state.attributes.get("occurred_observation_entities")
self.hass.states.set("sensor.test_monitored", "off")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert ["sensor.test_monitored"] == state.attributes.get(
"occurred_observation_entities"
)
self.hass.states.set("sensor.test_monitored1", "on")
self.hass.block_till_done()
state = self.hass.states.get("binary_sensor.test_binary")
assert ["sensor.test_monitored", "sensor.test_monitored1"] == sorted(
state.attributes.get("occurred_observation_entities")
)
for key, attrs in state.attributes.items():
json.dumps(attrs)
async def test_template_error(hass, caplog):
"""Test sensor with template error."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "template",
"value_template": "{{ xyz + 1 }}",
"prob_given_true": 0.9,
},
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
await async_setup_component(hass, "binary_sensor", config)
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "off"
assert "TemplateError" in caplog.text
assert "xyz" in caplog.text
async def test_update_request_with_template(hass):
"""Test sensor on template platform observations that gets an update request."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "template",
"value_template": "{{states('sensor.test_monitored') == 'off'}}",
"prob_given_true": 0.8,
"prob_given_false": 0.4,
}
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
await async_setup_component(hass, "binary_sensor", config)
await async_setup_component(hass, HA_DOMAIN, {})
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "off"
await hass.services.async_call(
HA_DOMAIN,
SERVICE_UPDATE_ENTITY,
{ATTR_ENTITY_ID: "binary_sensor.test_binary"},
blocking=True,
)
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "off"
async def test_update_request_without_template(hass):
"""Test sensor on template platform observations that gets an update request."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "off",
"prob_given_true": 0.9,
"prob_given_false": 0.4,
},
],
"prior": 0.2,
"probability_threshold": 0.32,
}
}
await async_setup_component(hass, "binary_sensor", config)
await async_setup_component(hass, HA_DOMAIN, {})
await hass.async_block_till_done()
hass.states.async_set("sensor.test_monitored", "on")
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "off"
await hass.services.async_call(
HA_DOMAIN,
SERVICE_UPDATE_ENTITY,
{ATTR_ENTITY_ID: "binary_sensor.test_binary"},
blocking=True,
)
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "off"
async def test_monitored_sensor_goes_away(hass):
"""Test sensor on template platform observations that goes away."""
config = {
"binary_sensor": {
"name": "Test_Binary",
"platform": "bayesian",
"observations": [
{
"platform": "state",
"entity_id": "sensor.test_monitored",
"to_state": "on",
"prob_given_true": 0.9,
"prob_given_false": 0.4,
},
],
"prior": 0.2,
"probability_threshold": 0.32,<|fim▁hole|> await async_setup_component(hass, HA_DOMAIN, {})
await hass.async_block_till_done()
hass.states.async_set("sensor.test_monitored", "on")
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "on"
hass.states.async_remove("sensor.test_monitored")
await hass.async_block_till_done()
assert hass.states.get("binary_sensor.test_binary").state == "on"<|fim▁end|> | }
}
await async_setup_component(hass, "binary_sensor", config) |
<|file_name|>fake_resourcequota.go<|end_file_name|><|fim▁begin|>/*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package fake
import (
api "k8s.io/client-go/pkg/api"
unversioned "k8s.io/client-go/pkg/api/unversioned"
v1 "k8s.io/client-go/pkg/api/v1"<|fim▁hole|> testing "k8s.io/client-go/testing"
)
// FakeResourceQuotas implements ResourceQuotaInterface
type FakeResourceQuotas struct {
Fake *FakeCore
ns string
}
var resourcequotasResource = unversioned.GroupVersionResource{Group: "", Version: "v1", Resource: "resourcequotas"}
func (c *FakeResourceQuotas) Create(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) {
obj, err := c.Fake.
Invokes(testing.NewCreateAction(resourcequotasResource, c.ns, resourceQuota), &v1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*v1.ResourceQuota), err
}
func (c *FakeResourceQuotas) Update(resourceQuota *v1.ResourceQuota) (result *v1.ResourceQuota, err error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateAction(resourcequotasResource, c.ns, resourceQuota), &v1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*v1.ResourceQuota), err
}
func (c *FakeResourceQuotas) UpdateStatus(resourceQuota *v1.ResourceQuota) (*v1.ResourceQuota, error) {
obj, err := c.Fake.
Invokes(testing.NewUpdateSubresourceAction(resourcequotasResource, "status", c.ns, resourceQuota), &v1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*v1.ResourceQuota), err
}
func (c *FakeResourceQuotas) Delete(name string, options *v1.DeleteOptions) error {
_, err := c.Fake.
Invokes(testing.NewDeleteAction(resourcequotasResource, c.ns, name), &v1.ResourceQuota{})
return err
}
func (c *FakeResourceQuotas) DeleteCollection(options *v1.DeleteOptions, listOptions v1.ListOptions) error {
action := testing.NewDeleteCollectionAction(resourcequotasResource, c.ns, listOptions)
_, err := c.Fake.Invokes(action, &v1.ResourceQuotaList{})
return err
}
func (c *FakeResourceQuotas) Get(name string) (result *v1.ResourceQuota, err error) {
obj, err := c.Fake.
Invokes(testing.NewGetAction(resourcequotasResource, c.ns, name), &v1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*v1.ResourceQuota), err
}
func (c *FakeResourceQuotas) List(opts v1.ListOptions) (result *v1.ResourceQuotaList, err error) {
obj, err := c.Fake.
Invokes(testing.NewListAction(resourcequotasResource, c.ns, opts), &v1.ResourceQuotaList{})
if obj == nil {
return nil, err
}
label, _, _ := testing.ExtractFromListOptions(opts)
if label == nil {
label = labels.Everything()
}
list := &v1.ResourceQuotaList{}
for _, item := range obj.(*v1.ResourceQuotaList).Items {
if label.Matches(labels.Set(item.Labels)) {
list.Items = append(list.Items, item)
}
}
return list, err
}
// Watch returns a watch.Interface that watches the requested resourceQuotas.
func (c *FakeResourceQuotas) Watch(opts v1.ListOptions) (watch.Interface, error) {
return c.Fake.
InvokesWatch(testing.NewWatchAction(resourcequotasResource, c.ns, opts))
}
// Patch applies the patch and returns the patched resourceQuota.
func (c *FakeResourceQuotas) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) {
obj, err := c.Fake.
Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, data, subresources...), &v1.ResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*v1.ResourceQuota), err
}<|fim▁end|> | labels "k8s.io/client-go/pkg/labels"
watch "k8s.io/client-go/pkg/watch" |
<|file_name|>cloneGraph_BFS.py<|end_file_name|><|fim▁begin|>class UndirectedGraphNode:
def __init__(self, x):
self.label = x
self.neighbors = []
#using DFS
class Solution:
# @param node, a undirected graph node
# @return a undirected graph node
def cloneGraph(self, node):
seen={}
visited=[]
seen[None] = None
<|fim▁hole|> refNode = visited.pop()
for n in refNode.neighbors:
if n not in seen:
neighBorNode = UndirectedGraphNode(n.label)
seen[refNode].neighbors.append(neighBorNode)
seen[n] = neighBorNode
visited.append(n)
else:
seen[refNode].neighbors.append(seen[n])
return head
A=UndirectedGraphNode(2)
B=UndirectedGraphNode(3)
C=UndirectedGraphNode(4)
A.neighbors.append(B)
A.neighbors.append(C)
B.neighbors.append(C)
N=Solution()
for i in N.cloneGraph(A).neighbors:
print i.label<|fim▁end|> | head = UndirectedGraphNode(node.label)
seen[node] = head
visited.append(node)
while len(visited) != 0: |
<|file_name|>component.ts<|end_file_name|><|fim▁begin|>import { Component } from '@angular/core';
@Component({<|fim▁hole|> styleUrls: [ 'style.scss' ]
})
export class LogoComponent {
}<|fim▁end|> | selector: 'logo-component',
templateUrl: 'template.html', |
<|file_name|>response.rs<|end_file_name|><|fim▁begin|>use super::error::InvalidJsonError;
use serde_json::Map;
use serde_json::Value as JsonValue;
/// The response from a command send to the DaZeus server.
#[derive(Debug, Clone, PartialEq)]
pub struct Response {
data: JsonValue,
}
impl Response {
/// Create a new response based upon a failure message.
///
/// This is used where the API expected a response returned but the DaZeus core could not
/// provide a valid response.
pub fn for_fail(msg: &str) -> Response {
let mut obj = Map::new();
obj.insert("success".to_string(), JsonValue::Bool(false));
obj.insert("reason".to_string(), JsonValue::String(msg.to_string()));
Response {
data: JsonValue::Object(obj),
}
}
/// Create a new response based upon a successful operation.
///
/// This is used when the API expected a response, but the DaZeus core was not called.
pub fn for_success() -> Response {
let mut obj = Map::new();
obj.insert("success".to_string(), JsonValue::Bool(true));
Response {
data: JsonValue::Object(obj),
}
}
/// Create a new response based on a Json object.
///
/// This is used by the bindings to create a new Response based on a json blob returned by the
/// DaZeus core instance.
pub fn from_json(data: &JsonValue) -> Result<Response, InvalidJsonError> {
Ok(Response { data: data.clone() })
}
/// Retrieve a property from the data object or return a default if it doesn't exist.
pub fn get_or<'a>(&'a self, prop: &'a str, default: &'a JsonValue) -> &'a JsonValue {
match self.get(prop) {
Some(val) => val,
None => default,
}
}
/// Retrieve a property from the data object.
///
/// Returns `Some(data)` if the property exists, or `None` if the property doesn't exist.
pub fn get<'a>(&'a self, prop: &'a str) -> Option<&'a JsonValue> {
match self.data {
JsonValue::Object(ref obj) => obj.get(prop),
_ => None,
}
}
/// Retrieve a string from the data object.
///
/// Returns `Some(str)` if the property exists and it was a string property, or `None` if the
/// property doesn't exist, or if it isn't of type `Json::String`.
pub fn get_str<'a>(&'a self, prop: &'a str) -> Option<&'a str> {
match self.get(prop) {
Some(&JsonValue::String(ref s)) => Some(&s[..]),
_ => None,
}
}
/// Retrieve a string from the data object, or return a default if no such string can be found.
pub fn get_str_or<'a>(&'a self, prop: &'a str, default: &'a str) -> &'a str {
match self.get_str(prop) {
Some(s) => s,
None => default,
}
}
/// Returns whether or not a property with the given name exists.
pub fn has(&self, prop: &str) -> bool {
self.get_str(prop).is_some()
}
/// Check whether a Response contains a `success` property and whether it was true.
pub fn has_success(&self) -> bool {
match self.get("success") {
Some(&JsonValue::Bool(true)) => true,
_ => false,
}
}<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>bit_util.rs<|end_file_name|><|fim▁begin|>// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
//! Utils for working with bits
use packed_simd::u8x64;
static BIT_MASK: [u8; 8] = [1, 2, 4, 8, 16, 32, 64, 128];
static POPCOUNT_TABLE: [u8; 256] = [
0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 3, 2, 3, 3, 4, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4,
3, 4, 4, 5, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5,
3, 4, 4, 5, 4, 5, 5, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4, 3, 4, 4, 5, 2, 3, 3, 4,
3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 4,
3, 4, 4, 5, 2, 3, 3, 4, 3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 2, 3, 3, 4, 3, 4, 4, 5,
3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 2, 3, 3, 4,
3, 4, 4, 5, 3, 4, 4, 5, 4, 5, 5, 6, 3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7,
3, 4, 4, 5, 4, 5, 5, 6, 4, 5, 5, 6, 5, 6, 6, 7, 4, 5, 5, 6, 5, 6, 6, 7, 5, 6, 6, 7,
6, 7, 7, 8,
];
/// Returns the nearest number that is `>=` than `num` and is a multiple of 64
#[inline]
pub fn round_upto_multiple_of_64(num: usize) -> usize {
round_upto_power_of_2(num, 64)
}
/// Returns the nearest multiple of `factor` that is `>=` than `num`. Here `factor` must
/// be a power of 2.
fn round_upto_power_of_2(num: usize, factor: usize) -> usize {
debug_assert!(factor > 0 && (factor & (factor - 1)) == 0);
(num + (factor - 1)) & !(factor - 1)
}
/// Returns whether bit at position `i` in `data` is set or not
#[inline]
pub fn get_bit(data: &[u8], i: usize) -> bool {
(data[i >> 3] & BIT_MASK[i & 7]) != 0
}
/// Returns whether bit at position `i` in `data` is set or not.
///
/// Note this doesn't do any bound checking, for performance reason. The caller is
/// responsible to guarantee that `i` is within bounds.
#[inline]
pub unsafe fn get_bit_raw(data: *const u8, i: usize) -> bool {
(*data.offset((i >> 3) as isize) & BIT_MASK[i & 7]) != 0
}
/// Sets bit at position `i` for `data`
#[inline]
pub fn set_bit(data: &mut [u8], i: usize) {
data[i >> 3] |= BIT_MASK[i & 7]
}
/// Sets bit at position `i` for `data`
///
/// Note this doesn't do any bound checking, for performance reason. The caller is
/// responsible to guarantee that `i` is within bounds.
#[inline]
pub unsafe fn set_bit_raw(data: *mut u8, i: usize) {
*data.offset((i >> 3) as isize) |= BIT_MASK[i & 7]
}
/// Returns the number of 1-bits in `data`
#[inline]
pub fn count_set_bits(data: &[u8]) -> usize {
let mut count: usize = 0;
for u in data {
count += POPCOUNT_TABLE[*u as usize] as usize;
}
count
}
/// Returns the number of 1-bits in `data`, starting from `offset` with `length` bits
/// inspected. Note that both `offset` and `length` are measured in bits.
#[inline]
pub fn count_set_bits_offset(data: &[u8], offset: usize, length: usize) -> usize {
let bit_end = offset + length;
assert!(bit_end <= (data.len() << 3));
let byte_start = ::std::cmp::min(round_upto_power_of_2(offset, 8), bit_end);
let num_bytes = (bit_end - byte_start) >> 3;
let mut result = 0;
for i in offset..byte_start {
if get_bit(data, i) {
result += 1;
}
}
for i in 0..num_bytes {
result += POPCOUNT_TABLE[data[(byte_start >> 3) + i] as usize] as usize;
}
for i in (byte_start + (num_bytes << 3))..bit_end {
if get_bit(data, i) {
result += 1;
}
}
result
}
/// Returns the ceil of `value`/`divisor`
#[inline]
pub fn ceil(value: usize, divisor: usize) -> usize {
let mut result = value / divisor;
if value % divisor != 0 {
result += 1
};
result
}
/// Performs SIMD bitwise binary operations.
///
/// Note that each slice should be 64 bytes and it is the callers responsibility to ensure
/// that this is the case. If passed slices larger than 64 bytes the operation will only
/// be performed on the first 64 bytes. Slices less than 64 bytes will panic.
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
pub unsafe fn bitwise_bin_op_simd<F>(left: &[u8], right: &[u8], result: &mut [u8], op: F)
where
F: Fn(u8x64, u8x64) -> u8x64,
{
let left_simd = u8x64::from_slice_unaligned_unchecked(left);
let right_simd = u8x64::from_slice_unaligned_unchecked(right);
let simd_result = op(left_simd, right_simd);
simd_result.write_to_slice_unaligned_unchecked(result);
}
#[cfg(test)]
mod tests {
use rand::{thread_rng, Rng};
use std::collections::HashSet;
use super::*;
#[test]
fn test_round_upto_multiple_of_64() {
assert_eq!(0, round_upto_multiple_of_64(0));
assert_eq!(64, round_upto_multiple_of_64(1));
assert_eq!(64, round_upto_multiple_of_64(63));
assert_eq!(64, round_upto_multiple_of_64(64));
assert_eq!(128, round_upto_multiple_of_64(65));
assert_eq!(192, round_upto_multiple_of_64(129));
}
#[test]
fn test_get_bit() {
// 00001101
assert_eq!(true, get_bit(&[0b00001101], 0));
assert_eq!(false, get_bit(&[0b00001101], 1));
assert_eq!(true, get_bit(&[0b00001101], 2));
assert_eq!(true, get_bit(&[0b00001101], 3));
// 01001001 01010010
assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 0));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 1));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 2));
assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 3));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 4));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 5));
assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 6));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 7));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 8));
assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 9));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 10));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 11));
assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 12));
assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 13));<|fim▁hole|> assert_eq!(false, get_bit(&[0b01001001, 0b01010010], 15));
}
#[test]
fn test_get_bit_raw() {
const NUM_BYTE: usize = 10;
let mut buf = vec![0; NUM_BYTE];
let mut expected = vec![];
let mut rng = thread_rng();
for i in 0..8 * NUM_BYTE {
let b = rng.gen_bool(0.5);
expected.push(b);
if b {
set_bit(&mut buf[..], i)
}
}
let raw_ptr = buf.as_ptr();
for (i, b) in expected.iter().enumerate() {
unsafe {
assert_eq!(*b, get_bit_raw(raw_ptr, i));
}
}
}
#[test]
fn test_set_bit() {
let mut b = [0b00000000];
set_bit(&mut b, 0);
assert_eq!([0b00000001], b);
set_bit(&mut b, 2);
assert_eq!([0b00000101], b);
set_bit(&mut b, 5);
assert_eq!([0b00100101], b);
}
#[test]
fn test_set_bit_raw() {
const NUM_BYTE: usize = 10;
let mut buf = vec![0; NUM_BYTE];
let mut expected = vec![];
let mut rng = thread_rng();
for i in 0..8 * NUM_BYTE {
let b = rng.gen_bool(0.5);
expected.push(b);
if b {
unsafe {
set_bit_raw(buf.as_mut_ptr(), i);
}
}
}
let raw_ptr = buf.as_ptr();
for (i, b) in expected.iter().enumerate() {
unsafe {
assert_eq!(*b, get_bit_raw(raw_ptr, i));
}
}
}
#[test]
fn test_get_set_bit_roundtrip() {
const NUM_BYTES: usize = 10;
const NUM_SETS: usize = 10;
let mut buffer: [u8; NUM_BYTES * 8] = [0; NUM_BYTES * 8];
let mut v = HashSet::new();
let mut rng = thread_rng();
for _ in 0..NUM_SETS {
let offset = rng.gen_range(0, 8 * NUM_BYTES);
v.insert(offset);
set_bit(&mut buffer[..], offset);
}
for i in 0..NUM_BYTES * 8 {
assert_eq!(v.contains(&i), get_bit(&buffer[..], i));
}
}
#[test]
fn test_count_bits_slice() {
assert_eq!(0, count_set_bits(&[0b00000000]));
assert_eq!(8, count_set_bits(&[0b11111111]));
assert_eq!(3, count_set_bits(&[0b00001101]));
assert_eq!(6, count_set_bits(&[0b01001001, 0b01010010]));
}
#[test]
fn test_count_bits_offset_slice() {
assert_eq!(8, count_set_bits_offset(&[0b11111111], 0, 8));
assert_eq!(3, count_set_bits_offset(&[0b11111111], 0, 3));
assert_eq!(5, count_set_bits_offset(&[0b11111111], 3, 5));
assert_eq!(1, count_set_bits_offset(&[0b11111111], 3, 1));
assert_eq!(0, count_set_bits_offset(&[0b11111111], 8, 0));
assert_eq!(2, count_set_bits_offset(&[0b01010101], 0, 3));
assert_eq!(16, count_set_bits_offset(&[0b11111111, 0b11111111], 0, 16));
assert_eq!(10, count_set_bits_offset(&[0b11111111, 0b11111111], 0, 10));
assert_eq!(10, count_set_bits_offset(&[0b11111111, 0b11111111], 3, 10));
assert_eq!(8, count_set_bits_offset(&[0b11111111, 0b11111111], 8, 8));
assert_eq!(5, count_set_bits_offset(&[0b11111111, 0b11111111], 11, 5));
assert_eq!(0, count_set_bits_offset(&[0b11111111, 0b11111111], 16, 0));
assert_eq!(2, count_set_bits_offset(&[0b01101101, 0b10101010], 7, 5));
assert_eq!(4, count_set_bits_offset(&[0b01101101, 0b10101010], 7, 9));
}
#[test]
fn test_ceil() {
assert_eq!(ceil(0, 1), 0);
assert_eq!(ceil(1, 1), 1);
assert_eq!(ceil(1, 2), 1);
assert_eq!(ceil(1, 8), 1);
assert_eq!(ceil(7, 8), 1);
assert_eq!(ceil(8, 8), 1);
assert_eq!(ceil(9, 8), 2);
assert_eq!(ceil(9, 9), 1);
assert_eq!(ceil(10000000000, 10), 1000000000);
assert_eq!(ceil(10, 10000000000), 1);
assert_eq!(ceil(10000000000, 1000000000), 10);
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[test]
fn test_bitwise_and_simd() {
let buf1 = [0b00110011u8; 64];
let buf2 = [0b11110000u8; 64];
let mut buf3 = [0b00000000; 64];
unsafe { bitwise_bin_op_simd(&buf1, &buf2, &mut buf3, |a, b| a & b) };
for i in buf3.iter() {
assert_eq!(&0b00110000u8, i);
}
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
#[test]
fn test_bitwise_or_simd() {
let buf1 = [0b00110011u8; 64];
let buf2 = [0b11110000u8; 64];
let mut buf3 = [0b00000000; 64];
unsafe { bitwise_bin_op_simd(&buf1, &buf2, &mut buf3, |a, b| a | b) };
for i in buf3.iter() {
assert_eq!(&0b11110011u8, i);
}
}
}<|fim▁end|> | assert_eq!(true, get_bit(&[0b01001001, 0b01010010], 14)); |
<|file_name|>bench.rs<|end_file_name|><|fim▁begin|>#![feature(test, recover)]
extern crate kirk;
extern crate crossbeam;
extern crate test;
use std::panic::RecoverSafe;
use std::sync::Arc;
use std::sync::atomic::{AtomicUsize, Ordering};
use test::{Bencher, black_box};
use kirk::{Job, Pool, Task, Deque, Channel};
struct NopJob;
impl Job for NopJob {
fn perform(self) {
}
}
struct AtomicJob(Arc<AtomicUsize>);
impl RecoverSafe for AtomicJob {}
impl Job for AtomicJob {
fn perform(self) {
let AtomicJob(counter) = self;
black_box(counter.fetch_add(1, Ordering::Relaxed));
}
}
#[inline]
fn fib(n: u64) -> u64 {
(0..n).fold((0, 1), |(a, b), _| (b, a + b)).0
}
struct FibJob(u64);
impl Job for FibJob {
fn perform(self) {
let FibJob(n) = self;
black_box(fib(n));
}
}
#[bench]
fn startup_and_teardown(mut b: &mut Bencher) {
let mut options = kirk::crew::deque::Options::default();
options.num_workers = 1;
b.iter(|| {
crossbeam::scope(|scope| {
let _ = Pool::<Deque<Task>>::scoped(&scope, options);
});
});
}
#[bench]
fn startup_and_teardown_channel(mut b: &mut Bencher) {
let mut options = kirk::crew::channel::Options::default();
options.num_workers = 1;
b.iter(|| {
crossbeam::scope(|scope| {
let _ = Pool::<Channel<Task>>::scoped(&scope, options);
});
});
}
#[bench]
fn enqueue_nop_job(b: &mut Bencher) {
let mut options = kirk::crew::deque::Options::default();
options.num_workers = 1;
crossbeam::scope(|scope| {
let mut pool = Pool::<Deque<NopJob>>::scoped(&scope, options);
b.iter(|| pool.push(NopJob));
});
}
#[bench]
fn enqueue_nop_job_channel(b: &mut Bencher) {
let mut options = kirk::crew::channel::Options::default();
options.num_workers = 1;
crossbeam::scope(|scope| {
let mut pool = Pool::<Channel<NopJob>>::scoped(&scope, options);
b.iter(|| pool.push(NopJob));
});
}
#[bench]
fn enqueue_nop_task(b: &mut Bencher) {
let mut options = kirk::crew::deque::Options::default();
options.num_workers = 1;
crossbeam::scope(|scope| {
let mut pool = Pool::<Deque<Task>>::scoped(&scope, options);
b.iter(|| {
pool.push(move || {
black_box(0);
});
})
});
}
#[bench]
fn enqueue_nop_task_channel(b: &mut Bencher) {
let mut options = kirk::crew::channel::Options::default();
options.num_workers = 1;
crossbeam::scope(|scope| {
let mut pool = Pool::<Channel<Task>>::scoped(&scope, options);
b.iter(|| {
pool.push(move || {
black_box(0);
});
})
});<|fim▁hole|>}
#[bench]
fn enqueue_atomic_task(b: &mut Bencher) {
let mut options = kirk::crew::deque::Options::default();
options.num_workers = 1;
let counter = Arc::new(AtomicUsize::new(0));
crossbeam::scope(|scope| {
let mut pool = Pool::<Deque<Task>>::scoped(&scope, options);
b.iter(|| {
let counter = counter.clone();
pool.push(move || {
black_box(counter.fetch_add(1, Ordering::Relaxed));
});
})
});
}
#[bench]
fn enqueue_atomic_task_channel(b: &mut Bencher) {
let mut options = kirk::crew::channel::Options::default();
options.num_workers = 1;
let counter = Arc::new(AtomicUsize::new(0));
crossbeam::scope(|scope| {
let mut pool = Pool::<Channel<Task>>::scoped(&scope, options);
b.iter(|| {
let counter = counter.clone();
pool.push(move || {
black_box(counter.fetch_add(1, Ordering::Relaxed));
});
})
});
}
#[bench]
fn enqueue_atomic_job(b: &mut Bencher) {
let mut options = kirk::crew::deque::Options::default();
options.num_workers = 1;
let counter = Arc::new(AtomicUsize::new(0));
crossbeam::scope(|scope| {
let mut pool = Pool::<Deque<AtomicJob>>::scoped(&scope, options);
b.iter(|| {
pool.push(AtomicJob(counter.clone()));
})
});
}
#[bench]
fn enqueue_atomic_job_channel(b: &mut Bencher) {
let mut options = kirk::crew::channel::Options::default();
options.num_workers = 1;
let counter = Arc::new(AtomicUsize::new(0));
crossbeam::scope(|scope| {
let mut pool = Pool::<Channel<AtomicJob>>::scoped(&scope, options);
b.iter(|| {
pool.push(AtomicJob(counter.clone()));
})
});
}
#[bench]
fn enqueue_fib_task(b: &mut Bencher) {
let options = kirk::crew::deque::Options::default();
crossbeam::scope(|scope| {
let mut pool = Pool::<Deque<Task>>::scoped(&scope, options);
b.iter(|| {
pool.push(move || {
black_box(fib(1000000));
});
});
});
}
#[bench]
fn enqueue_fib_task_channel(b: &mut Bencher) {
let options = kirk::crew::channel::Options::default();
crossbeam::scope(|scope| {
let mut pool = Pool::<Channel<Task>>::scoped(&scope, options);
b.iter(|| {
pool.push(move || {
black_box(fib(1000000));
});
});
});
}
#[bench]
fn enqueue_fib_job(b: &mut Bencher) {
let options = kirk::crew::deque::Options::default();
crossbeam::scope(|scope| {
let mut pool = Pool::<Deque<FibJob>>::scoped(&scope, options);
b.iter(|| {
pool.push(black_box(FibJob(1000000)));
});
});
}
#[bench]
fn enqueue_fib_job_channel(b: &mut Bencher) {
let options = kirk::crew::channel::Options::default();
crossbeam::scope(|scope| {
let mut pool = Pool::<Channel<FibJob>>::scoped(&scope, options);
b.iter(|| {
pool.push(black_box(FibJob(1000000)));
});
});
}<|fim▁end|> | |
<|file_name|>Isolate_stack_ROI2.py<|end_file_name|><|fim▁begin|>from ij import IJ
from ij.gui import NonBlockingGenericDialog
from ij import WindowManager
from ij.gui import WaitForUserDialog
from ij import ImageStack
from ij import ImagePlus
theImage = IJ.getImage()
sourceImages = []
if theImage.getNChannels() == 1:
IJ.run("8-bit")
sourceImages.append(theImage)
else:
sourceImages = ChannelSplitter.split(theImage)
sourceNames = []
for im in sourceImages:
im.show()
sourceNames.append(im.getTitle())
gd0 = NonBlockingGenericDialog("Select source image...")
gd0.addChoice("Source image",sourceNames,sourceNames[0])
gd0.showDialog()
if (gd0.wasOKed()):
chosenImage = gd0.getNextChoice()
theImage = WindowManager.getImage(chosenImage)
IJ.selectWindow(chosenImage)
else:
theImage = sourceImages[0]
IJ.selectWindow(sourceNames[0])
gd = NonBlockingGenericDialog("Set slice params...")
gd.addNumericField("Slice start:",1,0)
gd.addNumericField("Slice end:",theImage.getNSlices(),0)
gd.showDialog()
if (gd.wasOKed()):
## Selecting the ROI over the stack
startSlice = int(gd.getNextNumber())
endSlice = gd.getNextNumber()
width = theImage.getWidth()
height = theImage.getHeight()
roiArray = []
for i in range(startSlice,endSlice+1):
theImage.setSlice(i)
bp = theImage.getProcessor().duplicate()
bp.setColor(0)
doStaySlice = True
while doStaySlice:
waiter = WaitForUserDialog("Draw ROI","Draw ROI, then hit OK")
waiter.show()
roi = theImage.getRoi()
if roi is None:
doStaySlice = True
else:
doStaySlice = False
roiArray.append(roi)
## Applying the ROI to each channel
newStacks = []
castImages = []
for procImage in sourceImages:
newStacks.append(ImageStack(width,height))
ns = newStacks[-1]
for i in range(startSlice,endSlice+1):
procImage.setSliceWithoutUpdate(i)
bp = procImage.getProcessor().duplicate()
bp.fillOutside(roiArray[i-startSlice])
ns.addSlice(bp)
castImages.append(ImagePlus(procImage.getShortTitle()+"_cast",ns))
## Displays the output
for castImage in castImages:
castImage.show()
## Cleans up the windows<|fim▁hole|><|fim▁end|> | for sourceImage in sourceImages:
sourceImage.close() |
<|file_name|>models.py<|end_file_name|><|fim▁begin|>from django.db import models
import warnings
from django.utils import timezone
import requests
from image_cropping import ImageRatioField
class CompMember(models.Model):
"""A member of compsoc"""
class Meta:
verbose_name = 'CompSoc Member'
verbose_name_plural = 'CompSoc Members'
index = models.IntegerField(blank=False, help_text="This field is present just for ordering members based on their posts. President = 2, VPs = 1, Gen. Sec. = 0, Everyone else = -1", default=-1)
name = models.CharField(max_length=50, help_text='Enter your full name')
image = models.ImageField(blank=False, upload_to='member_images/', help_text='Please select a display image for yourself. This is necessary.')
cropping = ImageRatioField('image', '500x500')
alumni = models.BooleanField(default=False, help_text='Are you an alumni?')
role = models.CharField(max_length=100, help_text="Enter your post if you hold one. If not, enter 'Member'")
batch_of = models.CharField(max_length=4, default='2015', help_text='Enter the year you will graduate')
social_link = models.CharField(blank=True, max_length=256, help_text='Enter a link to your Facebook, Twitter, GitHub or any other social network profile. You can leave this blank if you wish!')
def get_social_link(self):
'''
Returns the social_link if present. Otherwise, sends javascript:void(0)
'''
if self.social_link == '':
return 'javascript:void(0)'
else:
return self.social_link
def __str__(self):
return self.name
class Variable(models.Model): ##NOTE: This should not be used anymore
def __str__(self):
warnings.warn('''You are using a "General Variable".
Stop doing that.
This is bad design on Arjoonn's part so don't fall into the same trap.
If you are using this for Orfik, that has already been fixed. If you are using this for logos, same thing.
Over a few cycles this entire table will be removed.<|fim▁hole|> name = models.CharField(max_length=100)
time = models.DateTimeField()
# Receive the pre_delete signal and delete the image associated with the model instance.
from django.db.models.signals import pre_delete
from django.dispatch.dispatcher import receiver
@receiver(pre_delete, sender=CompMember)
def compsoc_member_delete(sender, instance, **kwargs):
# Pass false so ImageField doesn't save the model.
instance.image.delete(False)<|fim▁end|> | ''')
return self.name |
<|file_name|>res_lang.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Copyright 2017 LasLabs Inc.
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class ResLang(models.Model):
_inherit = 'res.lang'
default_uom_ids = fields.Many2many(
string='Default Units',
comodel_name='product.uom',
)
@api.multi
@api.constrains('default_uom_ids')
def _check_default_uom_ids(self):
for record in self:
categories = set(record.default_uom_ids.mapped('category_id'))
if len(categories) != len(record.default_uom_ids):
raise ValidationError(_(
'Only one default unit of measure per category may '<|fim▁hole|> ))
@api.model
def default_uom_by_category(self, category_name, lang=None):
"""Return the default UoM for language for the input UoM Category.
Args:
category_name (str): Name of the UoM category to get the default
for.
lang (ResLang or str, optional): Recordset or code of the language
to get the default for. Will use the current user language if
omitted.
Returns:
ProductUom: Unit of measure representing the default, if set.
Empty recordset otherwise.
"""
if lang is None:
lang = self.env.user.lang
if isinstance(lang, basestring):
lang = self.env['res.lang'].search([
('code', '=', lang),
],
limit=1,
)
results = lang.default_uom_ids.filtered(
lambda r: r.category_id.name == category_name,
)
return results[:1]<|fim▁end|> | 'be selected.', |
<|file_name|>profile_core.py<|end_file_name|><|fim▁begin|>import cProfile
from pathlib import Path
<|fim▁hole|> try:
scenario_dir.mkdir(parents=True)
except FileExistsError:
pass
cProfile.runctx(
'from dmprsim.scenarios.python_profile import main;'
'main(args, results_dir, scenario_dir)',
globals=globals(),
locals=locals(),
filename=str(results_dir / 'profile.pstats'),
)<|fim▁end|> | def main(args, results_dir: Path, scenario_dir: Path): |
<|file_name|>eq.rs<|end_file_name|><|fim▁begin|>#![feature(core)]
extern crate core;
// macro_rules! e {
// ($e:expr) => { $e }
// }
// macro_rules! tuple_impls {
// ($(
// $Tuple:ident {
// $(($idx:tt) -> $T:ident)+
// }
// )+) => {
// $(
// #[stable(feature = "rust1", since = "1.0.0")]
// impl<$($T:Clone),+> Clone for ($($T,)+) {
// fn clone(&self) -> ($($T,)+) {
// ($(e!(self.$idx.clone()),)+)
// }
// }
//
// #[stable(feature = "rust1", since = "1.0.0")]
// impl<$($T:PartialEq),+> PartialEq for ($($T,)+) {
// #[inline]
// fn eq(&self, other: &($($T,)+)) -> bool {
// e!($(self.$idx == other.$idx)&&+)
// }
// #[inline]
// fn ne(&self, other: &($($T,)+)) -> bool {
// e!($(self.$idx != other.$idx)||+)
// }
// }
//
// #[stable(feature = "rust1", since = "1.0.0")]
// impl<$($T:Eq),+> Eq for ($($T,)+) {}
//
// #[stable(feature = "rust1", since = "1.0.0")]
// impl<$($T:PartialOrd + PartialEq),+> PartialOrd for ($($T,)+) {
// #[inline]
// fn partial_cmp(&self, other: &($($T,)+)) -> Option<Ordering> {
// lexical_partial_cmp!($(self.$idx, other.$idx),+)
// }
// #[inline]
// fn lt(&self, other: &($($T,)+)) -> bool {
// lexical_ord!(lt, $(self.$idx, other.$idx),+)
// }
// #[inline]
// fn le(&self, other: &($($T,)+)) -> bool {
// lexical_ord!(le, $(self.$idx, other.$idx),+)
// }
// #[inline]
// fn ge(&self, other: &($($T,)+)) -> bool {
// lexical_ord!(ge, $(self.$idx, other.$idx),+)
// }
// #[inline]
// fn gt(&self, other: &($($T,)+)) -> bool {
// lexical_ord!(gt, $(self.$idx, other.$idx),+)
// }
// }
//
// #[stable(feature = "rust1", since = "1.0.0")]
// impl<$($T:Ord),+> Ord for ($($T,)+) {
// #[inline]
// fn cmp(&self, other: &($($T,)+)) -> Ordering {
// lexical_cmp!($(self.$idx, other.$idx),+)
// }
// }
//
// #[stable(feature = "rust1", since = "1.0.0")]
// impl<$($T:Default),+> Default for ($($T,)+) {
// #[stable(feature = "rust1", since = "1.0.0")]
// #[inline]
// fn default() -> ($($T,)+) {
// ($({ let x: $T = Default::default(); x},)+)
// }
// }
// )+
// }
// }
// // Constructs an expression that performs a lexical ordering using method $rel.
// // The values are interleaved, so the macro invocation for
// // `(a1, a2, a3) < (b1, b2, b3)` would be `lexical_ord!(lt, a1, b1, a2, b2,
// // a3, b3)` (and similarly for `lexical_cmp`)
// macro_rules! lexical_ord {
// ($rel: ident, $a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
// if $a != $b { lexical_ord!($rel, $a, $b) }
// else { lexical_ord!($rel, $($rest_a, $rest_b),+) }
// };
// ($rel: ident, $a:expr, $b:expr) => { ($a) . $rel (& $b) };
// }
// macro_rules! lexical_partial_cmp {
// ($a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
// match ($a).partial_cmp(&$b) {
// Some(Equal) => lexical_partial_cmp!($($rest_a, $rest_b),+),
// ordering => ordering
// }
// };
// ($a:expr, $b:expr) => { ($a).partial_cmp(&$b) };
// }
// macro_rules! lexical_cmp {
// ($a:expr, $b:expr, $($rest_a:expr, $rest_b:expr),+) => {
// match ($a).cmp(&$b) {
// Equal => lexical_cmp!($($rest_a, $rest_b),+),
// ordering => ordering
// }
// };
// ($a:expr, $b:expr) => { ($a).cmp(&$b) };
// }
// tuple_impls! {
// Tuple1 {
// (0) -> A
// }
// Tuple2 {
// (0) -> A
// (1) -> B
// }
// Tuple3 {
// (0) -> A
// (1) -> B
// (2) -> C
// }
// Tuple4 {
// (0) -> A
// (1) -> B<|fim▁hole|> // }
// Tuple5 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// }
// Tuple6 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// }
// Tuple7 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// (6) -> G
// }
// Tuple8 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// (6) -> G
// (7) -> H
// }
// Tuple9 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// (6) -> G
// (7) -> H
// (8) -> I
// }
// Tuple10 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// (6) -> G
// (7) -> H
// (8) -> I
// (9) -> J
// }
// Tuple11 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// (6) -> G
// (7) -> H
// (8) -> I
// (9) -> J
// (10) -> K
// }
// Tuple12 {
// (0) -> A
// (1) -> B
// (2) -> C
// (3) -> D
// (4) -> E
// (5) -> F
// (6) -> G
// (7) -> H
// (8) -> I
// (9) -> J
// (10) -> K
// (11) -> L
// }
// }
#[cfg(test)]
mod tests {
macro_rules! eq_test {
(
$($T:ident)+
) => (
{
let left: ($($T,)+) = ($($T::default(),)+);
let right: ($($T,)+) = ($($T::default(),)+);
let result: bool = left.eq(&right);
assert_eq!(result, true);
}
{
let left: ($($T,)+) = ($($T::default(),)+);
let right: ($($T,)+) = ($($T::default(),)+);
let result: bool = left == right;
assert_eq!(result, true);
}
{
let left: ($($T,)+) = ($($T::default(),)+);
let right: ($($T,)+) = ($($T::default() + 1 as $T,)+);
let result: bool = left.eq(&right);
assert_eq!(result, false);
}
{
let left: ($($T,)+) = ($($T::default(),)+);
let right: ($($T,)+) = ($($T::default() + 1 as $T,)+);
let result: bool = left == right;
assert_eq!(result, false);
}
)
}
type A = u8;
type B = u16;
type C = u32;
type D = u64;
type E = usize;
type F = i8;
type G = i16;
type H = i32;
type I = i64;
type J = isize;
type K = f32;
type L = f64;
#[test]
fn eq_test1() {
eq_test! { A B C E F G H I J K L };
}
}<|fim▁end|> | // (2) -> C
// (3) -> D |
<|file_name|>InlineChordDefinition.ts<|end_file_name|><|fim▁begin|>import { IChordDefinition } from "./IChordDefinition";
import { Chord } from "./Chord";
import { IChordFingering } from "./IChordFingering";
export class InlineChordDefinition implements IChordDefinition {
constructor(private readonly chord: Chord) { }
get displayName(): string {
return this.chord.name || "";
<|fim▁hole|> }
}<|fim▁end|> | }
get fingering(): IChordFingering {
return this.chord.fingering!;
|
<|file_name|>form_group_spec.ts<|end_file_name|><|fim▁begin|>/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {async, fakeAsync, tick} from '@angular/core/testing';
import {AsyncTestCompleter, beforeEach, describe, inject, it} from '@angular/core/testing/testing_internal';
import {AbstractControl, FormArray, FormControl, FormGroup, Validators} from '@angular/forms';
import {EventEmitter} from '../src/facade/async';
import {isPresent} from '../src/facade/lang';
export function main() {
function asyncValidator(expected: string, timeouts = {}) {
return (c: AbstractControl) => {
let resolve: (result: any) => void;
const promise = new Promise(res => { resolve = res; });
const t = isPresent((timeouts as any)[c.value]) ? (timeouts as any)[c.value] : 0;
const res = c.value != expected ? {'async': true} : null;
if (t == 0) {
resolve(res);
} else {
setTimeout(() => { resolve(res); }, t);
}
return promise;
};
}
function asyncValidatorReturningObservable(c: FormControl) {
const e = new EventEmitter();
Promise.resolve(null).then(() => { e.emit({'async': true}); });
return e;
}
describe('FormGroup', () => {
describe('value', () => {
it('should be the reduced value of the child controls', () => {
const g = new FormGroup({'one': new FormControl('111'), 'two': new FormControl('222')});
expect(g.value).toEqual({'one': '111', 'two': '222'});
});
it('should be empty when there are no child controls', () => {
const g = new FormGroup({});
expect(g.value).toEqual({});
});
it('should support nested groups', () => {
const g = new FormGroup({
'one': new FormControl('111'),
'nested': new FormGroup({'two': new FormControl('222')})
});
expect(g.value).toEqual({'one': '111', 'nested': {'two': '222'}});
(<FormControl>(g.get('nested.two'))).setValue('333');
expect(g.value).toEqual({'one': '111', 'nested': {'two': '333'}});
});
});
describe('getRawValue', () => {
let fg: FormGroup;
it('should work with nested form groups/arrays', () => {
fg = new FormGroup({
'c1': new FormControl('v1'),
'group': new FormGroup({'c2': new FormControl('v2'), 'c3': new FormControl('v3')}),
'array': new FormArray([new FormControl('v4'), new FormControl('v5')])
});
fg.get('group').get('c3').disable();
(fg.get('array') as FormArray).at(1).disable();
expect(fg.getRawValue())
.toEqual({'c1': 'v1', 'group': {'c2': 'v2', 'c3': 'v3'}, 'array': ['v4', 'v5']});
});
});
describe('adding and removing controls', () => {
it('should update value and validity when control is added', () => {
const g = new FormGroup({'one': new FormControl('1')});
expect(g.value).toEqual({'one': '1'});
expect(g.valid).toBe(true);
g.addControl('two', new FormControl('2', Validators.minLength(10)));
expect(g.value).toEqual({'one': '1', 'two': '2'});
expect(g.valid).toBe(false);
});
it('should update value and validity when control is removed', () => {
const g = new FormGroup(<|fim▁hole|> {'one': new FormControl('1'), 'two': new FormControl('2', Validators.minLength(10))});
expect(g.value).toEqual({'one': '1', 'two': '2'});
expect(g.valid).toBe(false);
g.removeControl('two');
expect(g.value).toEqual({'one': '1'});
expect(g.valid).toBe(true);
});
});
describe('errors', () => {
it('should run the validator when the value changes', () => {
const simpleValidator = (c: FormGroup) =>
c.controls['one'].value != 'correct' ? {'broken': true} : null;
const c = new FormControl(null);
const g = new FormGroup({'one': c}, simpleValidator);
c.setValue('correct');
expect(g.valid).toEqual(true);
expect(g.errors).toEqual(null);
c.setValue('incorrect');
expect(g.valid).toEqual(false);
expect(g.errors).toEqual({'broken': true});
});
});
describe('dirty', () => {
let c: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('value');
g = new FormGroup({'one': c});
});
it('should be false after creating a control', () => { expect(g.dirty).toEqual(false); });
it('should be true after changing the value of the control', () => {
c.markAsDirty();
expect(g.dirty).toEqual(true);
});
});
describe('touched', () => {
let c: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('value');
g = new FormGroup({'one': c});
});
it('should be false after creating a control', () => { expect(g.touched).toEqual(false); });
it('should be true after control is marked as touched', () => {
c.markAsTouched();
expect(g.touched).toEqual(true);
});
});
describe('setValue', () => {
let c: FormControl, c2: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('');
c2 = new FormControl('');
g = new FormGroup({'one': c, 'two': c2});
});
it('should set its own value', () => {
g.setValue({'one': 'one', 'two': 'two'});
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set child values', () => {
g.setValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
});
it('should set child control values if disabled', () => {
c2.disable();
g.setValue({'one': 'one', 'two': 'two'});
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one'});
expect(g.getRawValue()).toEqual({'one': 'one', 'two': 'two'});
});
it('should set group value if group is disabled', () => {
g.disable();
g.setValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set parent values', () => {
const form = new FormGroup({'parent': g});
g.setValue({'one': 'one', 'two': 'two'});
expect(form.value).toEqual({'parent': {'one': 'one', 'two': 'two'}});
});
it('should not update the parent when explicitly specified', () => {
const form = new FormGroup({'parent': g});
g.setValue({'one': 'one', 'two': 'two'}, {onlySelf: true});
expect(form.value).toEqual({parent: {'one': '', 'two': ''}});
});
it('should throw if fields are missing from supplied value (subset)', () => {
expect(() => g.setValue({
'one': 'one'
})).toThrowError(new RegExp(`Must supply a value for form control with name: 'two'`));
});
it('should throw if a value is provided for a missing control (superset)', () => {
expect(() => g.setValue({'one': 'one', 'two': 'two', 'three': 'three'}))
.toThrowError(new RegExp(`Cannot find form control with name: three`));
});
it('should throw if a value is not provided for a disabled control', () => {
c2.disable();
expect(() => g.setValue({
'one': 'one'
})).toThrowError(new RegExp(`Must supply a value for form control with name: 'two'`));
});
it('should throw if no controls are set yet', () => {
const empty = new FormGroup({});
expect(() => empty.setValue({
'one': 'one'
})).toThrowError(new RegExp(`no form controls registered with this group`));
});
describe('setValue() events', () => {
let form: FormGroup;
let logger: any[];
beforeEach(() => {
form = new FormGroup({'parent': g});
logger = [];
});
it('should emit one valueChange event per control', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
g.setValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
form.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.setValue({'one': 'one', 'two': 'two'}, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
g.setValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
});
});
describe('patchValue', () => {
let c: FormControl, c2: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('');
c2 = new FormControl('');
g = new FormGroup({'one': c, 'two': c2});
});
it('should set its own value', () => {
g.patchValue({'one': 'one', 'two': 'two'});
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set child values', () => {
g.patchValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
});
it('should patch disabled control values', () => {
c2.disable();
g.patchValue({'one': 'one', 'two': 'two'});
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one'});
expect(g.getRawValue()).toEqual({'one': 'one', 'two': 'two'});
});
it('should patch disabled control groups', () => {
g.disable();
g.patchValue({'one': 'one', 'two': 'two'});
expect(c.value).toEqual('one');
expect(c2.value).toEqual('two');
expect(g.value).toEqual({'one': 'one', 'two': 'two'});
});
it('should set parent values', () => {
const form = new FormGroup({'parent': g});
g.patchValue({'one': 'one', 'two': 'two'});
expect(form.value).toEqual({'parent': {'one': 'one', 'two': 'two'}});
});
it('should not update the parent when explicitly specified', () => {
const form = new FormGroup({'parent': g});
g.patchValue({'one': 'one', 'two': 'two'}, {onlySelf: true});
expect(form.value).toEqual({parent: {'one': '', 'two': ''}});
});
it('should ignore fields that are missing from supplied value (subset)', () => {
g.patchValue({'one': 'one'});
expect(g.value).toEqual({'one': 'one', 'two': ''});
});
it('should not ignore fields that are null', () => {
g.patchValue({'one': null});
expect(g.value).toEqual({'one': null, 'two': ''});
});
it('should ignore any value provided for a missing control (superset)', () => {
g.patchValue({'three': 'three'});
expect(g.value).toEqual({'one': '', 'two': ''});
});
describe('patchValue() events', () => {
let form: FormGroup;
let logger: any[];
beforeEach(() => {
form = new FormGroup({'parent': g});
logger = [];
});
it('should emit one valueChange event per control', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
g.patchValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should not emit valueChange events for skipped controls', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
g.patchValue({'one': 'one'});
expect(logger).toEqual(['control1', 'group', 'form']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
form.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.patchValue({'one': 'one', 'two': 'two'}, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
g.patchValue({'one': 'one', 'two': 'two'});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
});
});
describe('reset()', () => {
let c: FormControl, c2: FormControl, g: FormGroup;
beforeEach(() => {
c = new FormControl('initial value');
c2 = new FormControl('');
g = new FormGroup({'one': c, 'two': c2});
});
it('should set its own value if value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': 'initial value', 'two': ''});
expect(g.value).toEqual({'one': 'initial value', 'two': ''});
});
it('should set its own value if boxed value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': {value: 'initial value', disabled: false}, 'two': ''});
expect(g.value).toEqual({'one': 'initial value', 'two': ''});
});
it('should clear its own value if no value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset();
expect(g.value).toEqual({'one': null, 'two': null});
});
it('should set the value of each of its child controls if value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': 'initial value', 'two': ''});
expect(c.value).toBe('initial value');
expect(c2.value).toBe('');
});
it('should clear the value of each of its child controls if no value passed', () => {
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset();
expect(c.value).toBe(null);
expect(c2.value).toBe(null);
});
it('should set the value of its parent if value passed', () => {
const form = new FormGroup({'g': g});
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset({'one': 'initial value', 'two': ''});
expect(form.value).toEqual({'g': {'one': 'initial value', 'two': ''}});
});
it('should clear the value of its parent if no value passed', () => {
const form = new FormGroup({'g': g});
g.setValue({'one': 'new value', 'two': 'new value'});
g.reset();
expect(form.value).toEqual({'g': {'one': null, 'two': null}});
});
it('should not update the parent when explicitly specified', () => {
const form = new FormGroup({'g': g});
g.reset({'one': 'new value', 'two': 'new value'}, {onlySelf: true});
expect(form.value).toEqual({g: {'one': 'initial value', 'two': ''}});
});
it('should mark itself as pristine', () => {
g.markAsDirty();
expect(g.pristine).toBe(false);
g.reset();
expect(g.pristine).toBe(true);
});
it('should mark all child controls as pristine', () => {
c.markAsDirty();
c2.markAsDirty();
expect(c.pristine).toBe(false);
expect(c2.pristine).toBe(false);
g.reset();
expect(c.pristine).toBe(true);
expect(c2.pristine).toBe(true);
});
it('should mark the parent as pristine if all siblings pristine', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsDirty();
expect(form.pristine).toBe(false);
g.reset();
expect(form.pristine).toBe(true);
});
it('should not mark the parent pristine if any dirty siblings', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsDirty();
c3.markAsDirty();
expect(form.pristine).toBe(false);
g.reset();
expect(form.pristine).toBe(false);
});
it('should mark itself as untouched', () => {
g.markAsTouched();
expect(g.untouched).toBe(false);
g.reset();
expect(g.untouched).toBe(true);
});
it('should mark all child controls as untouched', () => {
c.markAsTouched();
c2.markAsTouched();
expect(c.untouched).toBe(false);
expect(c2.untouched).toBe(false);
g.reset();
expect(c.untouched).toBe(true);
expect(c2.untouched).toBe(true);
});
it('should mark the parent untouched if all siblings untouched', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsTouched();
expect(form.untouched).toBe(false);
g.reset();
expect(form.untouched).toBe(true);
});
it('should not mark the parent untouched if any touched siblings', () => {
const c3 = new FormControl('');
const form = new FormGroup({'g': g, 'c3': c3});
g.markAsTouched();
c3.markAsTouched();
expect(form.untouched).toBe(false);
g.reset();
expect(form.untouched).toBe(false);
});
it('should retain previous disabled state', () => {
g.disable();
g.reset();
expect(g.disabled).toBe(true);
});
it('should set child disabled state if boxed value passed', () => {
g.disable();
g.reset({'one': {value: '', disabled: false}, 'two': ''});
expect(c.disabled).toBe(false);
expect(g.disabled).toBe(false);
});
describe('reset() events', () => {
let form: FormGroup, c3: FormControl, logger: any[];
beforeEach(() => {
c3 = new FormControl('');
form = new FormGroup({'g': g, 'c3': c3});
logger = [];
});
it('should emit one valueChange event per reset control', () => {
form.valueChanges.subscribe(() => logger.push('form'));
g.valueChanges.subscribe(() => logger.push('group'));
c.valueChanges.subscribe(() => logger.push('control1'));
c2.valueChanges.subscribe(() => logger.push('control2'));
c3.valueChanges.subscribe(() => logger.push('control3'));
g.reset();
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should not fire an event when explicitly specified', fakeAsync(() => {
form.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.valueChanges.subscribe((value) => { throw 'Should not happen'; });
c.valueChanges.subscribe((value) => { throw 'Should not happen'; });
g.reset({}, {emitEvent: false});
tick();
}));
it('should emit one statusChange event per reset control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
c3.statusChanges.subscribe(() => logger.push('control3'));
g.reset();
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
it('should emit one statusChange event per reset control', () => {
form.statusChanges.subscribe(() => logger.push('form'));
g.statusChanges.subscribe(() => logger.push('group'));
c.statusChanges.subscribe(() => logger.push('control1'));
c2.statusChanges.subscribe(() => logger.push('control2'));
c3.statusChanges.subscribe(() => logger.push('control3'));
g.reset({'one': {value: '', disabled: true}});
expect(logger).toEqual(['control1', 'control2', 'group', 'form']);
});
});
});
describe('contains', () => {
let group: FormGroup;
beforeEach(() => {
group = new FormGroup({
'required': new FormControl('requiredValue'),
'optional': new FormControl({value: 'disabled value', disabled: true})
});
});
it('should return false when the component is disabled',
() => { expect(group.contains('optional')).toEqual(false); });
it('should return false when there is no component with the given name',
() => { expect(group.contains('something else')).toEqual(false); });
it('should return true when the component is enabled', () => {
expect(group.contains('required')).toEqual(true);
group.enable('optional');
expect(group.contains('optional')).toEqual(true);
});
it('should support controls with dots in their name', () => {
expect(group.contains('some.name')).toBe(false);
group.addControl('some.name', new FormControl());
expect(group.contains('some.name')).toBe(true);
});
});
describe('statusChanges', () => {
let control: FormControl;
let group: FormGroup;
beforeEach(async(() => {
control = new FormControl('', asyncValidatorReturningObservable);
group = new FormGroup({'one': control});
}));
// TODO(kara): update these tests to use fake Async
it('should fire a statusChange if child has async validation change',
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
const loggedValues: string[] = [];
group.statusChanges.subscribe({
next: (status: string) => {
loggedValues.push(status);
if (loggedValues.length === 2) {
expect(loggedValues).toEqual(['PENDING', 'INVALID']);
}
async.done();
}
});
control.setValue('');
}));
});
describe('getError', () => {
it('should return the error when it is present', () => {
const c = new FormControl('', Validators.required);
const g = new FormGroup({'one': c});
expect(c.getError('required')).toEqual(true);
expect(g.getError('required', ['one'])).toEqual(true);
});
it('should return null otherwise', () => {
const c = new FormControl('not empty', Validators.required);
const g = new FormGroup({'one': c});
expect(c.getError('invalid')).toEqual(null);
expect(g.getError('required', ['one'])).toEqual(null);
expect(g.getError('required', ['invalid'])).toEqual(null);
});
});
describe('asyncValidator', () => {
it('should run the async validator', fakeAsync(() => {
const c = new FormControl('value');
const g = new FormGroup({'one': c}, null, asyncValidator('expected'));
expect(g.pending).toEqual(true);
tick(1);
expect(g.errors).toEqual({'async': true});
expect(g.pending).toEqual(false);
}));
it('should set the parent group\'s status to pending', fakeAsync(() => {
const c = new FormControl('value', null, asyncValidator('expected'));
const g = new FormGroup({'one': c});
expect(g.pending).toEqual(true);
tick(1);
expect(g.pending).toEqual(false);
}));
it('should run the parent group\'s async validator when children are pending',
fakeAsync(() => {
const c = new FormControl('value', null, asyncValidator('expected'));
const g = new FormGroup({'one': c}, null, asyncValidator('expected'));
tick(1);
expect(g.errors).toEqual({'async': true});
expect(g.get('one').errors).toEqual({'async': true});
}));
});
describe('disable() & enable()', () => {
it('should mark the group as disabled', () => {
const g = new FormGroup({'one': new FormControl(null)});
expect(g.disabled).toBe(false);
expect(g.valid).toBe(true);
g.disable();
expect(g.disabled).toBe(true);
expect(g.valid).toBe(false);
g.enable();
expect(g.disabled).toBe(false);
expect(g.valid).toBe(true);
});
it('should set the group status as disabled', () => {
const g = new FormGroup({'one': new FormControl(null)});
expect(g.status).toEqual('VALID');
g.disable();
expect(g.status).toEqual('DISABLED');
g.enable();
expect(g.status).toBe('VALID');
});
it('should mark children of the group as disabled', () => {
const c1 = new FormControl(null);
const c2 = new FormControl(null);
const g = new FormGroup({'one': c1, 'two': c2});
expect(c1.disabled).toBe(false);
expect(c2.disabled).toBe(false);
g.disable();
expect(c1.disabled).toBe(true);
expect(c2.disabled).toBe(true);
g.enable();
expect(c1.disabled).toBe(false);
expect(c2.disabled).toBe(false);
});
it('should ignore disabled controls in validation', () => {
const g = new FormGroup({
nested: new FormGroup({one: new FormControl(null, Validators.required)}),
two: new FormControl('two')
});
expect(g.valid).toBe(false);
g.get('nested').disable();
expect(g.valid).toBe(true);
g.get('nested').enable();
expect(g.valid).toBe(false);
});
it('should ignore disabled controls when serializing value', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one')}), two: new FormControl('two')});
expect(g.value).toEqual({'nested': {'one': 'one'}, 'two': 'two'});
g.get('nested').disable();
expect(g.value).toEqual({'two': 'two'});
g.get('nested').enable();
expect(g.value).toEqual({'nested': {'one': 'one'}, 'two': 'two'});
});
it('should update its value when disabled with disabled children', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one'), two: new FormControl('two')})});
g.get('nested.two').disable();
expect(g.value).toEqual({nested: {one: 'one'}});
g.get('nested').disable();
expect(g.value).toEqual({nested: {one: 'one', two: 'two'}});
g.get('nested').enable();
expect(g.value).toEqual({nested: {one: 'one', two: 'two'}});
});
it('should update its value when enabled with disabled children', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one'), two: new FormControl('two')})});
g.get('nested.two').disable();
expect(g.value).toEqual({nested: {one: 'one'}});
g.get('nested').enable();
expect(g.value).toEqual({nested: {one: 'one', two: 'two'}});
});
it('should ignore disabled controls when determining dirtiness', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one')}), two: new FormControl('two')});
g.get('nested.one').markAsDirty();
expect(g.dirty).toBe(true);
g.get('nested').disable();
expect(g.get('nested').dirty).toBe(true);
expect(g.dirty).toEqual(false);
g.get('nested').enable();
expect(g.dirty).toEqual(true);
});
it('should ignore disabled controls when determining touched state', () => {
const g = new FormGroup(
{nested: new FormGroup({one: new FormControl('one')}), two: new FormControl('two')});
g.get('nested.one').markAsTouched();
expect(g.touched).toBe(true);
g.get('nested').disable();
expect(g.get('nested').touched).toBe(true);
expect(g.touched).toEqual(false);
g.get('nested').enable();
expect(g.touched).toEqual(true);
});
it('should keep empty, disabled groups disabled when updating validity', () => {
const group = new FormGroup({});
expect(group.status).toEqual('VALID');
group.disable();
expect(group.status).toEqual('DISABLED');
group.updateValueAndValidity();
expect(group.status).toEqual('DISABLED');
group.addControl('one', new FormControl({value: '', disabled: true}));
expect(group.status).toEqual('DISABLED');
group.addControl('two', new FormControl());
expect(group.status).toEqual('VALID');
});
it('should re-enable empty, disabled groups', () => {
const group = new FormGroup({});
group.disable();
expect(group.status).toEqual('DISABLED');
group.enable();
expect(group.status).toEqual('VALID');
});
it('should not run validators on disabled controls', () => {
const validator = jasmine.createSpy('validator');
const g = new FormGroup({'one': new FormControl()}, validator);
expect(validator.calls.count()).toEqual(1);
g.disable();
expect(validator.calls.count()).toEqual(1);
g.setValue({one: 'value'});
expect(validator.calls.count()).toEqual(1);
g.enable();
expect(validator.calls.count()).toEqual(2);
});
describe('disabled errors', () => {
it('should clear out group errors when disabled', () => {
const g = new FormGroup({'one': new FormControl()}, () => ({'expected': true}));
expect(g.errors).toEqual({'expected': true});
g.disable();
expect(g.errors).toEqual(null);
g.enable();
expect(g.errors).toEqual({'expected': true});
});
it('should re-populate group errors when enabled from a child', () => {
const g = new FormGroup({'one': new FormControl()}, () => ({'expected': true}));
g.disable();
expect(g.errors).toEqual(null);
g.addControl('two', new FormControl());
expect(g.errors).toEqual({'expected': true});
});
it('should clear out async group errors when disabled', fakeAsync(() => {
const g = new FormGroup({'one': new FormControl()}, null, asyncValidator('expected'));
tick();
expect(g.errors).toEqual({'async': true});
g.disable();
expect(g.errors).toEqual(null);
g.enable();
tick();
expect(g.errors).toEqual({'async': true});
}));
it('should re-populate async group errors when enabled from a child', fakeAsync(() => {
const g = new FormGroup({'one': new FormControl()}, null, asyncValidator('expected'));
tick();
expect(g.errors).toEqual({'async': true});
g.disable();
expect(g.errors).toEqual(null);
g.addControl('two', new FormControl());
tick();
expect(g.errors).toEqual({'async': true});
}));
});
describe('disabled events', () => {
let logger: string[];
let c: FormControl;
let g: FormGroup;
let form: FormGroup;
beforeEach(() => {
logger = [];
c = new FormControl('', Validators.required);
g = new FormGroup({one: c});
form = new FormGroup({g: g});
});
it('should emit value change events in the right order', () => {
c.valueChanges.subscribe(() => logger.push('control'));
g.valueChanges.subscribe(() => logger.push('group'));
form.valueChanges.subscribe(() => logger.push('form'));
g.disable();
expect(logger).toEqual(['control', 'group', 'form']);
});
it('should emit status change events in the right order', () => {
c.statusChanges.subscribe(() => logger.push('control'));
g.statusChanges.subscribe(() => logger.push('group'));
form.statusChanges.subscribe(() => logger.push('form'));
g.disable();
expect(logger).toEqual(['control', 'group', 'form']);
});
});
});
describe('updateTreeValidity()', () => {
let c: FormControl, c2: FormControl, c3: FormControl;
let nested: FormGroup, form: FormGroup;
let logger: string[];
beforeEach(() => {
c = new FormControl('one');
c2 = new FormControl('two');
c3 = new FormControl('three');
nested = new FormGroup({one: c, two: c2});
form = new FormGroup({nested: nested, three: c3});
logger = [];
c.statusChanges.subscribe(() => logger.push('one'));
c2.statusChanges.subscribe(() => logger.push('two'));
c3.statusChanges.subscribe(() => logger.push('three'));
nested.statusChanges.subscribe(() => logger.push('nested'));
form.statusChanges.subscribe(() => logger.push('form'));
});
it('should update tree validity', () => {
form._updateTreeValidity();
expect(logger).toEqual(['one', 'two', 'nested', 'three', 'form']);
});
it('should not emit events when turned off', () => {
form._updateTreeValidity({emitEvent: false});
expect(logger).toEqual([]);
});
});
describe('setControl()', () => {
let c: FormControl;
let g: FormGroup;
beforeEach(() => {
c = new FormControl('one');
g = new FormGroup({one: c});
});
it('should replace existing control with new control', () => {
const c2 = new FormControl('new!', Validators.minLength(10));
g.setControl('one', c2);
expect(g.controls['one']).toEqual(c2);
expect(g.value).toEqual({one: 'new!'});
expect(g.valid).toBe(false);
});
it('should add control if control did not exist before', () => {
const c2 = new FormControl('new!', Validators.minLength(10));
g.setControl('two', c2);
expect(g.controls['two']).toEqual(c2);
expect(g.value).toEqual({one: 'one', two: 'new!'});
expect(g.valid).toBe(false);
});
it('should remove control if new control is null', () => {
g.setControl('one', null);
expect(g.controls['one']).not.toBeDefined();
expect(g.value).toEqual({});
});
it('should only emit value change event once', () => {
const logger: string[] = [];
const c2 = new FormControl('new!');
g.valueChanges.subscribe(() => logger.push('change!'));
g.setControl('one', c2);
expect(logger).toEqual(['change!']);
});
});
});
}<|fim▁end|> | |
<|file_name|>ExtensibleObject.js<|end_file_name|><|fim▁begin|>function extensibleObject() {
let obj = {
extend: function(template){
for(let parentProp of Object.keys(template)){
if(typeof(template[parentProp]) == 'function'){
Object.getPrototypeOf(obj)[parentProp] = template[parentProp];<|fim▁hole|> }
}
}
};
return obj;
}<|fim▁end|> | } else {
obj[parentProp] = template[parentProp]; |
<|file_name|>bitcoin_gl.ts<|end_file_name|><|fim▁begin|><?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="gl">
<context>
<name>AboutDialog</name>
<message>
<location filename="../forms/aboutdialog.ui" line="+14"/>
<source>About Gridcoin</source>
<translation>Acerca de Gridcoin</translation>
</message>
<message>
<location line="+39"/>
<source><b>Gridcoin</b> </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<source>
This is experimental software.
Distributed under the MIT/X11 software license, see the accompanying file COPYING or https://opensource.org/licenses/mit-license.php.
This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (https://www.openssl.org/) and cryptographic software written by Eric Young ([email protected]) and UPnP software written by Thomas Bernard.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AddressBookPage</name>
<message>
<location filename="../forms/addressbookpage.ui" line="+14"/>
<source>Address Book</source>
<translation>Libreta de direccións</translation>
</message>
<message>
<location line="+6"/>
<source>These are your Gridcoin addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.</source>
<translation>Estas son as túas dIreccións de Gridcoin para recibir os pagos. Pode que quieras asignarlle unha a cada remitente e así reconocer quen te está a pagar.</translation>
</message>
<message>
<location line="+16"/>
<source>Double-click to edit address or label</source>
<translation>Doble click para editar a dirección ou a etiqueta</translation>
</message>
<message>
<location line="+27"/>
<source>Create a new address</source>
<translation>Crear unha nova dirección</translation>
</message>
<message>
<location line="+3"/>
<source>&New</source>
<translation>&Novo</translation>
</message>
<message>
<location line="+11"/>
<source>Copy the currently selected address to the system clipboard</source>
<translation>Copiar a dirección seleccionada ao cartafol</translation>
</message>
<message>
<location line="+3"/>
<source>&Copy</source>
<translation>&Copiar</translation>
</message>
<message>
<location line="+11"/>
<source>Show &QR Code</source>
<translation>Amosar &QR Code</translation>
</message>
<message>
<location line="+11"/>
<source>Sign a message to prove you own a Gridcoin address</source>
<translation>Firma a mensaxe para probar que tes unha dirección Gridcoin</translation>
</message>
<message>
<location line="+3"/>
<source>Sign &Message</source>
<translation>Firmar &Mensaxe</translation>
</message>
<message>
<location line="+11"/>
<source>Verify a message to ensure it was signed with a specified Gridcoin address</source>
<translation>Verifica a mensaxe para asegurar que foi asinada por unha concreta dirección de Gridcoin</translation>
</message>
<message>
<location line="+3"/>
<source>&Verify Message</source>
<translation>&Verificar Mensaxe.</translation>
</message>
<message>
<location line="+11"/>
<source>Delete the currently selected address from the list</source>
<translation>Borrar a dirección actualmente seleccionada da listaxe</translation>
</message>
<message>
<location line="+3"/>
<source>&Delete</source>
<translation>&Borrar</translation>
</message>
<message>
<location filename="../addressbookpage.cpp" line="+65"/>
<source>Copy &Label</source>
<translation>Copiar &Etiqueta</translation>
</message>
<message>
<location line="+2"/>
<source>&Edit</source>
<translation>&Modificar</translation>
</message>
<message>
<location line="+249"/>
<source>Export Address Book Data</source>
<translation>Exportar datos da libreta de direccións.</translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Arquivo separado por comas (*.csv)</translation>
</message>
<message>
<location line="+13"/>
<source>Error exporting</source>
<translation>Error exportando</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation>Non se puido escribir a arquivo %1</translation>
</message>
</context>
<context>
<name>AddressTableModel</name>
<message>
<location filename="../addresstablemodel.cpp" line="+145"/>
<source>Label</source>
<translation>Etiqueta</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Dirección</translation>
</message>
<message>
<location line="+36"/>
<source>(no label)</source>
<translation>(sen etiqueta)</translation>
</message>
</context>
<context>
<name>AskPassphraseDialog</name>
<message>
<location filename="../forms/askpassphrasedialog.ui" line="+26"/>
<source>Passphrase Dialog</source>
<translation>Diálogo de Contrasinal</translation>
</message>
<message>
<location line="+21"/>
<source>Enter passphrase</source>
<translation>Introduce contrasinal</translation>
</message>
<message>
<location line="+14"/>
<source>New passphrase</source>
<translation>Novo contrasinal</translation>
</message>
<message>
<location line="+14"/>
<source>Repeat new passphrase</source>
<translation>Repite novo contrasinal</translation>
</message>
<message>
<location line="+30"/>
<source>Serves to disable the trivial sendmoney when OS account compromised. Provides no real security.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>For staking only</source>
<translation>Para "staking" só</translation>
</message>
<message>
<location filename="../askpassphrasedialog.cpp" line="+37"/>
<source>Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>ten or more random characters</b>, or <b>eight or more words</b>.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Encrypt wallet</source>
<translation>Encriptar moedeiro</translation>
</message>
<message>
<location line="+7"/>
<source>This operation needs your wallet passphrase to unlock the wallet.</source>
<translation>Esta operación precisa o contrasinal do teu moedeiro para desbloquear o moedeiro.</translation>
</message>
<message>
<location line="+5"/>
<source>Unlock wallet</source>
<translation>Desbloquear moedeiro</translation>
</message>
<message>
<location line="+3"/>
<source>This operation needs your wallet passphrase to decrypt the wallet.</source>
<translation>Esta operación precisa o contrasinal do teu moedeiro para desencriptar o moedeiro.</translation>
</message>
<message>
<location line="+5"/>
<source>Decrypt wallet</source>
<translation>Desencriptar moedeiro</translation>
</message>
<message>
<location line="+3"/>
<source>Change passphrase</source>
<translation>Cambiar contrasinal</translation>
</message>
<message>
<location line="+1"/>
<source>Enter the old and new passphrase to the wallet.</source>
<translation>Introduce o vello e novo contrasinais no moedeiro.</translation>
</message>
<message>
<location line="+45"/>
<source>Confirm wallet encryption</source>
<translation>Confirmar encriptación de moedeiro</translation>
</message>
<message>
<location line="+1"/>
<source>Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR COINS</b>!</source>
<translation>Coidado: Se enctriptas a tua carteira e perdes o contrasinal, <b>PERDERÁS TODAS AS TÚAS MOEDAS</b>!</translation>
</message>
<message>
<location line="+0"/>
<source>Are you sure you wish to encrypt your wallet?</source>
<translation>Estás seguro de que desexas encriptar o teu moedeiro?</translation>
</message>
<message>
<location line="+9"/>
<location line="+60"/>
<source>Wallet encrypted</source>
<translation>Moedeiro encriptado</translation>
</message>
<message>
<location line="-58"/>
<source>Gridcoin will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your coins from being stolen by malware infecting your computer.</source>
<translation>Gridcoin pecharase agora para rematar o proceso de encriptación. Recorda que encriptar a túa carteira non te protexe na totalidade do roubo das tuas moedas por infeccións de malware no teu ordenador.</translation>
</message>
<message>
<location line="+4"/>
<source>IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.</source>
<translation>IMPORTANTE: Calquera copia de seguridade previa que fixeses do teu arquivo de moedeiro debería ser substituída polo recén xerado arquivo encriptado de moedeiro. Por razóns de seguridade, as copias de seguridade previas de un arquivo de moedeiro desencriptado tornaránse inútiles no momento no que comeces a emprega-lo novo, encriptado, moedeiro.</translation>
</message>
<message>
<location line="+9"/>
<location line="+7"/>
<location line="+44"/>
<location line="+6"/>
<source>Wallet encryption failed</source>
<translation>Encriptación de moedeiro fallida</translation>
</message>
<message>
<location line="-56"/>
<source>Wallet encryption failed due to an internal error. Your wallet was not encrypted.</source>
<translation>A encriptación do moedeiro fallou por mor dun erro interno. O teu moedeiro non foi encriptado.</translation>
</message>
<message>
<location line="+7"/>
<location line="+50"/>
<source>The supplied passphrases do not match.</source>
<translation>Os contrasinais suministrados non coinciden.</translation>
</message>
<message>
<location line="-38"/>
<source>Wallet unlock failed</source>
<translation>Desbloqueo de moedeiro fallido</translation>
</message>
<message>
<location line="+1"/>
<location line="+12"/>
<location line="+19"/>
<source>The passphrase entered for the wallet decryption was incorrect.</source>
<translation>O contrasinal introducido para a desencriptación do moedeiro foi incorrecto.</translation>
</message>
<message>
<location line="-20"/>
<source>Wallet decryption failed</source>
<translation>Desencriptación de moedeiro fallida</translation>
</message>
<message>
<location line="+14"/>
<source>Wallet passphrase was successfully changed.</source>
<translation>Cambiouse con éxito o contrasinal do moedeiro.</translation>
</message>
<message>
<location line="+48"/>
<location line="+24"/>
<source>Warning: The Caps Lock key is on!</source>
<translation>Precaución: A tecla de Bloqueo de Maiúsculas está activada!</translation>
</message>
</context>
<context>
<name>BitcoinGUI</name>
<message>
<location filename="../bitcoingui.cpp" line="+115"/>
<source>Gridcoin</source>
<translation>Gridcoin</translation>
</message>
<message>
<location line="+141"/>
<source>Send coins to a Gridcoin address</source>
<translation>Enviar moedas a unha dirección Gridcoin</translation>
</message>
<message>
<location line="+5"/>
<source>Show the list of addresses for receiving payments</source>
<translation>Amosa a lista de dirección para recibir os pagos</translation>
</message>
<message>
<location line="+9"/>
<source>&Address Book</source>
<translation>&Libreta de Direccións</translation>
</message>
<message>
<location line="+1"/>
<source>Edit the list of stored addresses and labels</source>
<translation>Edita a lista de direccións e etiquetas almaceadas</translation>
</message>
<message>
<location line="+9"/>
<source>&Block Explorer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Block Explorer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Exchange</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<location line="+4"/>
<source>Web Site</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1"/>
<source>&Web Site</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>&GRC Chat Room</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>GRC Chatroom</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&BOINC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Gridcoin rewards distributed computing with BOINC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>&About Gridcoin</source>
<translation>&Sobre Gridcoin</translation>
</message>
<message>
<location line="+1"/>
<source>Show information about Gridcoin</source>
<translation>Amosa información sobre Gridcoin</translation>
</message>
<message>
<location line="+1166"/>
<location line="+17"/>
<location line="+9"/>
<source>none</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Scraper: waiting on wallet to sync.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Scraper: superblock not needed - inactive.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Scraper: downloading and processing stats.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+32"/>
<source>Scraper: No convergence able to be achieved. Will retry in a few minutes.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1290"/>
<source>&Voting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Voting</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+53"/>
<source>&Diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Modify configuration options for Gridcoin</source>
<translation>Modificar opcións de configuración para Gridcoin</translation>
</message>
<message>
<location line="+10"/>
<source>Encrypt or decrypt wallet</source>
<translation>Encriptar ou desencriptar carteira</translation>
</message>
<message>
<location line="+2"/>
<source>&Backup Wallet/Config...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Backup wallet/config to another location</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Unlock Wallet...</source>
<translation>&Desbloquear Carteira...</translation>
</message>
<message>
<location line="+1"/>
<source>Unlock wallet</source>
<translation>Desbloquear carteira</translation>
</message>
<message>
<location line="+1"/>
<source>&Lock Wallet</source>
<translation>&Bloquear Carteira</translation>
</message>
<message>
<location line="+1"/>
<source>Lock wallet</source>
<translation>Bloquear carteira</translation>
</message>
<message>
<location line="+1"/>
<source>Sign &message...</source>
<translation>&Asinar mensaxe...</translation>
</message>
<message>
<location line="+3"/>
<source>&Export...</source>
<translation>&Exportar...</translation>
</message>
<message>
<location line="+1"/>
<source>Export the data in the current tab to a file</source>
<translation>Exportar datos da pestana actual a un arquivo</translation>
</message>
<message>
<location line="+94"/>
<source>&Community</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+140"/>
<location line="+9"/>
<source>[testnet]</source>
<translation>[testnet]</translation>
</message>
<message>
<location line="+0"/>
<location line="+85"/>
<source>Gridcoin client</source>
<translation>Cliente Gridcoin</translation>
</message>
<message numerus="yes">
<location line="+141"/>
<source>Processed %n block(s) of transaction history.</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message>
<location line="+47"/>
<source>Last received block was generated %1.</source>
<translation>Último bloque recibido foi generado %1.</translation>
</message>
<message>
<location line="+87"/>
<source>This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Confirm transaction fee</source>
<translation>Confirmar cuota da transacción</translation>
</message>
<message>
<location line="+404"/>
<source>not available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>year</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>month</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>%1 times per %2</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Staking.<br>Your weight is %1<br>Network weight is %2<br><b>Estimated</b> staking frequency is %3.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Unable to stake: %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Not staking currently: %1, <b>Estimated</b> staking frequency is %2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+93"/>
<source>Scraper: Convergence achieved, date/time %1 UTC.
Project(s) excluded: %2.
Scrapers included: %3.
Scraper(s) excluded: %4.
Scraper(s) not publishing: %5.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Scraper: Convergence achieved, date/time %1 UTC.
Project(s) excluded: %2.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-558"/>
<source>Date: %1
Amount: %2
Type: %3
Address: %4</source>
<translation type="unfinished">Data: %1
Cantidade: %2
Tipo: %3
Dirección: %4</translation>
</message>
<message>
<location line="+190"/>
<location line="+15"/>
<source>URI can not be parsed! This can be caused by an invalid Gridcoin address or malformed URI parameters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-15"/>
<location line="+15"/>
<source>URI handling</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Wallet is <b>encrypted</b> and currently %1 </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source><b>unlocked for staking only</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source><b>fully unlocked</b></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+35"/>
<source>Backup Wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Data (*.dat)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="+6"/>
<source>Backup Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-6"/>
<location line="+6"/>
<source>There was an error trying to save the wallet data to the new location.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-3"/>
<source>Backup Config</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Wallet Config (*.conf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1011"/>
<source>&Overview</source>
<translation>&Vista xeral</translation>
</message>
<message>
<location line="+1"/>
<source>Show general overview of wallet</source>
<translation>Amosar vista xeral do moedeiro</translation>
</message>
<message>
<location line="+14"/>
<source>&Transactions</source>
<translation>&Transacciones</translation>
</message>
<message>
<location line="+1"/>
<source>Browse transaction history</source>
<translation>Navegar historial de transaccións</translation>
</message>
<message>
<location line="+52"/>
<source>E&xit</source>
<translation>&Saír</translation>
</message>
<message>
<location line="+1"/>
<source>Quit application</source>
<translation>Saír da aplicación</translation>
</message>
<message>
<location line="+14"/>
<source>&Options...</source>
<translation>&Opcións...</translation>
</message>
<message>
<location line="+10"/>
<source>&Encrypt Wallet...</source>
<translation>&Encriptar Moedeiro...</translation>
</message>
<message>
<location line="+5"/>
<source>&Change Passphrase...</source>
<translation>&Cambiar contrasinal...</translation>
</message>
<message>
<location line="+1"/>
<source>Change the passphrase used for wallet encryption</source>
<translation>Cambiar o contrasinal empregado para a encriptación do moedeiro</translation>
</message>
<message>
<location line="+10"/>
<source>&Debug window</source>
<translation>Ventana de &Depuración</translation>
</message>
<message>
<location line="+1"/>
<source>Open debugging and diagnostic console</source>
<translation>Abrir consola de depuración e diagnóstico</translation>
</message>
<message>
<location line="-5"/>
<source>&Verify message...</source>
<translation>&Verificar mensaxe...</translation>
</message>
<message>
<location line="-240"/>
<source>Wallet</source>
<translation>Moedeiro</translation>
</message>
<message>
<location line="+140"/>
<source>&Send</source>
<translation>&Enviar</translation>
</message>
<message>
<location line="+5"/>
<source>&Receive</source>
<translation>&Recibir</translation>
</message>
<message>
<location line="+78"/>
<source>Open config &file...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Open the config file in your standard editor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>&Researcher Wizard...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Open BOINC and beacon settings for Gridcoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>&Show / Hide</source>
<translation>&Amosar/Agachar</translation>
</message>
<message>
<location line="+19"/>
<source>&Snapshot Download</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Download and apply latest snapshot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+63"/>
<source>&File</source>
<translation>&Arquivo</translation>
</message>
<message>
<location line="+15"/>
<source>&Settings</source>
<translation>Axus&tes</translation>
</message>
<message>
<location line="+20"/>
<source>&Help</source>
<translation>A&xuda</translation>
</message>
<message>
<location line="+82"/>
<source>Not staking: Miner is not initialized.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+266"/>
<source>No active connections to the Gridcoin network. If this persists more than a few minutes, please check your configuration and your network connectivity.</source>
<translation type="unfinished"></translation>
</message>
<message numerus="yes">
<location line="+6"/>
<source>%n active connection(s) to the Gridcoin network</source>
<translation type="unfinished">
<numerusform></numerusform>
<numerusform></numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+26"/>
<source>%n second(s) ago</source>
<translation type="unfinished">
<numerusform>Fai %n segundo</numerusform>
<numerusform>Fai %n segundo</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n minute(s) ago</source>
<translation type="unfinished">
<numerusform>Fai %n minuto</numerusform>
<numerusform>Fai %n minuto</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n hour(s) ago</source>
<translation type="unfinished">
<numerusform>Fai %n hora</numerusform>
<numerusform>Fai %n hora</numerusform>
</translation>
</message>
<message numerus="yes">
<location line="+4"/>
<source>%n day(s) ago</source>
<translation type="unfinished">
<numerusform>Fai %n día</numerusform>
<numerusform>Fai %n día</numerusform>
</translation>
</message>
<message>
<location line="+6"/>
<source>Up to date</source>
<translation>Actualizado</translation>
</message>
<message>
<location line="+8"/>
<source>Catching up...</source>
<translation>Poñendo ao día...</translation>
</message>
<message>
<location line="+129"/>
<source>Sent transaction</source>
<translation>Transacción enviada</translation>
</message>
<message>
<location line="+1"/>
<source>Incoming transaction</source>
<translation>Transacción entrante</translation>
</message>
<message>
<location line="+17"/>
<source>Do you wish to download and apply the latest snapshot? If yes the wallet will shutdown and perform the task.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Warning: Canceling after stage 2 will result in sync from 0 or corrupted blockchain files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+216"/>
<source>Wallet is <b>encrypted</b> and currently <b>locked</b></source>
<translation>O moedeiro está <b>encriptado</b> e actualmente <b>bloqueado</b></translation>
</message>
<message>
<location line="+355"/>
<source>CPID: %1
Beacon age: %2
Expires: %3
%4</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../bitcoin.cpp" line="+215"/>
<source>A fatal error occurred. Gridcoin can no longer continue safely and will quit.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ClientModel</name>
<message>
<location filename="../clientmodel.cpp" line="+124"/>
<source>Network Alert</source>
<translation>Alerta de Rede</translation>
</message>
</context>
<context>
<name>CoinControlDialog</name>
<message>
<location filename="../forms/coincontroldialog.ui" line="+14"/>
<source>Coin Control</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+28"/>
<source>Quantity:</source>
<translation>Cantidade:</translation>
</message>
<message>
<location line="+23"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+39"/>
<source>Amount:</source>
<translation>Importe:</translation>
</message>
<message>
<location line="+23"/>
<source>Priority:</source>
<translation>Prioridade:</translation>
</message>
<message>
<location line="+39"/>
<source>Fee:</source>
<translation>Pago:</translation>
</message>
<message>
<location line="+26"/>
<source>Low Output:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+42"/>
<source>After Fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Change:</source>
<translation>Cambiar:</translation>
</message>
<message>
<location line="+63"/>
<source>(un)select all</source>
<translation>(des)selecciona todo</translation>
</message>
<message>
<location line="+13"/>
<source>Tree &mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>&List mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+50"/>
<source>Label</source>
<translation type="unfinished">Etiqueta</translation>
</message>
<message>
<location line="+5"/>
<source>Address</source>
<translation>Dirección</translation>
</message>
<message>
<location line="+18"/>
<source>Priority</source>
<translation>Prioridade</translation>
</message>
<message>
<location line="-28"/>
<source>Amount</source>
<translation>Cantidade</translation>
</message>
<message>
<location line="+15"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+5"/>
<source>Confirmations</source>
<translation>Confirmacións</translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed</source>
<translation>Confirmado</translation>
</message>
<message>
<location filename="../coincontroldialog.cpp" line="+36"/>
<source>Copy address</source>
<translation>Copiar dirección</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Copiar etiqueta</translation>
</message>
<message>
<location line="+1"/>
<location line="+26"/>
<source>Copy amount</source>
<translation>Copiar cantidade</translation>
</message>
<message>
<location line="-25"/>
<source>Copy transaction ID</source>
<translation>Copiar ID de transacción</translation>
</message>
<message>
<location line="+24"/>
<source>Copy quantity</source>
<translation>Copiar cantidade</translation>
</message>
<message>
<location line="+2"/>
<source>Copy fee</source>
<translation>Copiar pago</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Copiar despóis do pago</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Copiar bytes</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Copiar prioridade</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Copiar cambio</translation>
</message>
<message>
<location line="+317"/>
<source>highest</source>
<translation>O máis alto</translation>
</message>
<message>
<location line="+1"/>
<source>high</source>
<translation>alto</translation>
</message>
<message>
<location line="+1"/>
<source>medium-high</source>
<translation>medio-alto</translation>
</message>
<message>
<location line="+1"/>
<source>medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>low-medium</source>
<translation>medio-baixo</translation>
</message>
<message>
<location line="+1"/>
<source>low</source>
<translation>baixo</translation>
</message>
<message>
<location line="+1"/>
<source>lowest</source>
<translation>o máis baixo</translation>
</message>
<message>
<location line="+155"/>
<source>no</source>
<translation>non</translation>
</message>
<message>
<location line="+0"/>
<source>DUST</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>yes</source>
<translation>Si</translation>
</message>
<message>
<location line="+10"/>
<source>This label turns red, if the transaction size is bigger than 10000 bytes.
This means a fee of at least %1 per kb is required.
Can vary +/- 1 Byte per input.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Transactions with higher priority get more likely into a block.
This label turns red, if the priority is smaller than "medium".
This means a fee of at least %1 per kb is required.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if any recipient receives an amount smaller than %1.
This means a fee of at least %2 is required.
Amounts below 0.546 times the minimum relay fee are shown as DUST.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>This label turns red, if the change is smaller than %1.
This means a fee of at least %2 is required.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+37"/>
<location line="+63"/>
<source>(no label)</source>
<translation>(sen etiqueta)</translation>
</message>
<message>
<location line="-9"/>
<source>change from %1 (%2)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>(change)</source>
<translation>(cambio)</translation>
</message>
</context>
<context>
<name>DiagnosticsDialog</name>
<message>
<location filename="../forms/diagnosticsdialog.ui" line="+14"/>
<location line="+163"/>
<source>Diagnostics</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+55"/>
<source>Verify BOINC path</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-69"/>
<source>Verify CPID has RAC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-71"/>
<source>Verify CPID has valid beacon </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+64"/>
<source>Overall Result</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+108"/>
<source>Verify listen port for full node</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+42"/>
<source>Verify connections to network </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+103"/>
<source>Verify wallet is synced</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-71"/>
<source>Verify CPID is valid</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-67"/>
<source>Verify clock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+106"/>
<source>Verify connections to seeds</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-7"/>
<source>Check client version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+71"/>
<source>Check estimated time to stake </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+54"/>
<source>Close</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Test</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../diagnosticsdialog.cpp" line="+50"/>
<source>Testing...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>N/A</source>
<translation type="unfinished">N/A</translation>
</message>
<message>
<location line="+4"/>
<source>Passed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Warning</source>
<translation type="unfinished">Precaución</translation>
</message>
<message>
<location line="+4"/>
<source>Failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+296"/>
<location line="+5"/>
<source>Failed: ETTS is infinite. No coins to stake.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Warning: 45 days < ETTS = %1 <= 90 days</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Passed: ETTS = %1 <= 45 days</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+34"/>
<source>Warning: Count = %1 (Pass = 3+)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<location line="+22"/>
<source>Passed: Count = %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-17"/>
<location line="+22"/>
<source>Failed: Count = %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-10"/>
<source>Warning: Count = %1 (Pass = 8+)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<source>Warning: New Client version available:
%1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+100"/>
<source>Warning: Cannot connect to NTP server</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+32"/>
<source>Warning: Port 32749 may be blocked by your firewall</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>EditAddressDialog</name>
<message>
<location filename="../forms/editaddressdialog.ui" line="+14"/>
<source>Edit Address</source>
<translation>Modificar Dirección</translation>
</message>
<message>
<location line="+11"/>
<source>&Label</source>
<translation>&Etiqueta</translation>
</message>
<message>
<location line="+10"/>
<source>The label associated with this address book entry</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>The address associated with this address book entry. This can only be modified for sending addresses.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-10"/>
<source>&Address</source>
<translation>&Dirección</translation>
</message>
<message>
<location filename="../editaddressdialog.cpp" line="+20"/>
<source>New receiving address</source>
<translation>Nova dirección para recibir</translation>
</message>
<message>
<location line="+4"/>
<source>New sending address</source>
<translation>Nova dirección para enviar</translation>
</message>
<message>
<location line="+3"/>
<source>Edit receiving address</source>
<translation>Modificar dirección para recibir</translation>
</message>
<message>
<location line="+4"/>
<source>Edit sending address</source>
<translation>Modificar dirección para enviar</translation>
</message>
<message>
<location line="+71"/>
<source>The entered address "%1" is not a valid Gridcoin address.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>The entered address "%1" is already in the address book.</source>
<translation>A dirección introducida "%1" xa está no libro de direccións.</translation>
</message>
<message>
<location line="+5"/>
<source>Could not unlock wallet.</source>
<translation>Non se puido desbloquear o moedeiro.</translation>
</message>
<message>
<location line="+5"/>
<source>New key generation failed.</source>
<translation>A xeración de nova clave fallou.</translation>
</message>
</context>
<context>
<name>GUIUtil::HelpMessageBox</name>
<message>
<location filename="../guiutil.cpp" line="+644"/>
<source>version</source>
<translation type="unfinished">versión</translation>
</message>
<message>
<location line="+2"/>
<source>Usage:</source>
<translation type="unfinished">Emprego:</translation>
</message>
<message>
<location line="+1"/>
<source>command-line options</source>
<translation type="unfinished">opcións da liña de comandos</translation>
</message>
<message>
<location line="+4"/>
<source>UI options</source>
<translation>Opcións UI</translation>
</message>
<message>
<location line="+1"/>
<source>Set language, for example "de_DE" (default: system locale)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Start minimized</source>
<translation>Comezar minimizado</translation>
</message>
<message>
<location line="+1"/>
<source>Show splash screen on startup (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Gridcoin-Qt</source>
<translation>Gridcoin-Qt</translation>
</message>
</context>
<context>
<name>NewPollDialog</name>
<message>
<location filename="../votingdialog.cpp" line="+992"/>
<location line="+122"/>
<source>Create Poll</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-107"/>
<source>Title: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Days: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Question: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Discussion URL: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Share Type: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Magnitude+Balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Response Type: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Yes/No/Abstain</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Single Choice</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Multiple Choice</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Cost:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>50 GRC + transaction fee</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Add Item</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Remove Item</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Clear All</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<source>Please unlock the wallet.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>OptionsDialog</name>
<message>
<location filename="../forms/optionsdialog.ui" line="+14"/>
<source>Options</source>
<translation>Opcións</translation>
</message>
<message>
<location line="+16"/>
<source>&Main</source>
<translation>&Principal</translation>
</message>
<message>
<location line="+21"/>
<source>Reser&ve</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+33"/>
<source>Automatically start Gridcoin after logging in to the system.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Start Gridcoin on system login</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+49"/>
<source>Automatically open the Gridcoin client port on the router. This only works when your router supports UPnP and it is enabled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Connect to the Gridcoin network through a SOCKS proxy (e.g. when connecting through Tor).</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Connect through SOCKS proxy:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Pro&xy IP:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>IP address of the proxy (e.g. 127.0.0.1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+33"/>
<source>SOCKS &Version:</source>
<translation>&Version de SOCKS:</translation>
</message>
<message>
<location line="+13"/>
<source>SOCKS version of the proxy (e.g. 5)</source>
<translation>Versión SOCKS del proxy (exemplo: 5)</translation>
</message>
<message>
<location line="+52"/>
<source>Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.</source>
<translation>Minimizar en lugar de saír da aplicación cando se pecha a xanela. Cando se habilita esta opción, a aplicación so se pechará tras seleccionar Saír no menú.</translation>
</message>
<message>
<location line="+52"/>
<source>The user interface language can be set here. This setting will take effect after restarting Gridcoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+35"/>
<source>Style:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Choose a stylesheet to change the look of the wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Whether to show Gridcoin addresses in the transaction list or not.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Display addresses in transaction list</source>
<translation>&Visualizar direccións na listaxe de transaccións</translation>
</message>
<message>
<location line="+7"/>
<source>Whether to show coin control features or not.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Display coin &control features (advanced users only!)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+103"/>
<source>&Apply</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-364"/>
<source>&Network</source>
<translation>&Rede</translation>
</message>
<message>
<location line="-94"/>
<source>Reserved amount secures a balance in wallet that can be spendable at anytime. However reserve will secure utxo(s) of any size to respect this setting.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<source>Start minimized</source>
<translation type="unfinished">Comezar minimizado</translation>
</message>
<message>
<location line="+12"/>
<source>Allow regular checks for updates</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Disable &update checks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+30"/>
<source>Map port using &UPnP</source>
<translation>Mapear porto empregando &UPnP</translation>
</message>
<message>
<location line="+45"/>
<source>&Port:</source>
<translation>&Porto:</translation>
</message>
<message>
<location line="+19"/>
<source>Port of the proxy (e.g. 9050)</source>
<translation>Porto do proxy (exemplo: 9050)</translation>
</message>
<message>
<location line="+56"/>
<source>&Window</source>
<translation>&Xanela</translation>
</message>
<message>
<location line="+6"/>
<source>Show only a tray icon after minimizing the window.</source>
<translation>Amosar so un icono na bandexa tras minimiza-la xanela.</translation>
</message>
<message>
<location line="+3"/>
<source>&Minimize to the tray instead of the taskbar</source>
<translation>&Minimizar á bandexa en lugar de á barra de tarefas.</translation>
</message>
<message>
<location line="+10"/>
<source>M&inimize on close</source>
<translation>M&inimizar ao pechar</translation>
</message>
<message>
<location line="+7"/>
<source>Disable Transaction Notifications</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>&Display</source>
<translation>&Visualización</translation>
</message>
<message>
<location line="+8"/>
<source>User Interface &language:</source>
<translation>&Linguaxe de interface de usuario:</translation>
</message>
<message>
<location line="+24"/>
<source>&Unit to show amounts in:</source>
<translation>&Unidade na que amosar as cantidades:</translation>
</message>
<message>
<location line="+13"/>
<source>Choose the default subdivision unit to show in the interface and when sending coins.</source>
<translation>Escolle a unidade de subdivisión por defecto para amosar na interface e ao enviar moedas.</translation>
</message>
<message>
<location line="+49"/>
<source>Only display transactions on or after </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Setting this will cause the transaction table to only display transactions created on or after this date.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+70"/>
<source>&OK</source>
<translation>&OK</translation>
</message>
<message>
<location line="+7"/>
<source>&Cancel</source>
<translation>&Cancelar</translation>
</message>
<message>
<location filename="../optionsdialog.cpp" line="+56"/>
<source>default</source>
<translation>por defecto</translation>
</message>
<message>
<location line="+22"/>
<source>Native</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source>Light</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Dark</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+139"/>
<location line="+9"/>
<source>Warning</source>
<translation type="unfinished">Precaución</translation>
</message>
<message>
<location line="-9"/>
<location line="+9"/>
<source>This setting will take effect after restarting Gridcoin.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<source>The supplied proxy address is invalid.</source>
<translation>A dirección de proxy suministrada é inválida.</translation>
</message>
</context>
<context>
<name>OverviewPage</name>
<message>
<location filename="../forms/overviewpage.ui" line="+32"/>
<source>Form</source>
<translation>Formulario</translation>
</message>
<message>
<location line="+39"/>
<source>Wallet</source>
<translation type="unfinished">Moedeiro</translation>
</message>
<message>
<location line="+10"/>
<location line="+578"/>
<source>The displayed information may be out of date. Your wallet automatically synchronizes with the Gridcoin network after a connection is established, but this process has not completed yet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-539"/>
<source>Available:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+56"/>
<source>Total of transactions that have yet to be confirmed, and do not yet count toward the current balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<source>Total mined coins that have not yet matured.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+56"/>
<source>Staking</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>Blocks:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Difficulty:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Net Weight:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Coin Weight:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>Researcher</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+87"/>
<source>Pending Reward:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Open the researcher/beacon configuration wizard.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Beacon...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<source>Action Needed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+199"/>
<source>Error Messages:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-304"/>
<source>Magnitude:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-17"/>
<source>CPID:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-17"/>
<source>Status:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+225"/>
<source>Recent transactions</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+96"/>
<source>Current Poll:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-606"/>
<source>Your current spendable balance</source>
<translation>O teu balance actualmente dispoñible</translation>
</message>
<message>
<location line="+13"/>
<source>Immature Stake:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Amount staked for a recent block that must wait for 110 confirmations to mature before you can spend it.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Unconfirmed:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Immature:</source>
<translation>Inmaduro:</translation>
</message>
<message>
<location line="+20"/>
<source>Total:</source>
<translation>Total:</translation>
</message>
<message>
<location line="+7"/>
<source>Your current total balance</source>
<translation>O teu balance actual total</translation>
</message>
<message>
<location filename="../overviewpage.cpp" line="+144"/>
<location line="+1"/>
<source>out of sync</source>
<translation>non sincronizado</translation>
</message>
</context>
<context>
<name>ProjectTableModel</name>
<message>
<location filename="../researcher/projecttablemodel.cpp" line="+123"/>
<source>Name</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Eligible</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Whitelist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Magnitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Avg. Credit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>CPID</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../bitcoin.cpp" line="+103"/>
<source>Error: Specified data directory "%1" does not exist.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Error: Cannot obtain a lock on the specified data directory. An instance is probably already using that directory.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Error: Cannot parse configuration file.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+184"/>
<source>%1 didn't yet exit safely...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../guiutil.cpp" line="-601"/>
<source>N/A</source>
<translation type="unfinished">N/A</translation>
</message>
<message>
<location line="+0"/>
<source>%1 ms</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<location line="+30"/>
<source>%1 s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-24"/>
<source>%1 B</source>
<translation type="unfinished">%1 B</translation>
</message>
<message>
<location line="+2"/>
<source>%1 KB</source>
<translation type="unfinished">%1 KB</translation>
</message>
<message>
<location line="+2"/>
<source>%1 MB</source>
<translation type="unfinished">%1 MB</translation>
</message>
<message>
<location line="+2"/>
<source>%1 GB</source>
<translation type="unfinished">%1 GB</translation>
</message>
<message>
<location line="+12"/>
<source>%1 d</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>%1 h</source>
<translation type="unfinished">%1 h</translation>
</message>
<message>
<location line="+2"/>
<source>%1 m</source>
<translation type="unfinished">%1 m</translation>
</message>
<message>
<location line="+43"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>QRCodeDialog</name>
<message>
<location filename="../forms/qrcodedialog.ui" line="+14"/>
<source>QR Code Dialog</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+62"/>
<source>Request Payment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Label:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>Message:</source>
<translation type="unfinished">Mensaxe:</translation>
</message>
<message>
<location line="+25"/>
<source>Amount:</source>
<translation type="unfinished">Importe:</translation>
</message>
<message>
<location line="+46"/>
<source>&Save As...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qrcodedialog.cpp" line="+62"/>
<source>Error encoding URI into QR Code.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+40"/>
<source>The entered amount is invalid, please check.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Resulting URI too long, try to reduce the text for label / message.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Save QR Code</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>PNG Images (*.png)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>RPCConsole</name>
<message>
<location filename="../forms/rpcconsole.ui" line="+51"/>
<location line="+7"/>
<location line="+36"/>
<location line="+47"/>
<location line="+16"/>
<location line="+23"/>
<location line="+16"/>
<location line="+36"/>
<location line="+16"/>
<location line="+30"/>
<location line="+58"/>
<location line="+43"/>
<location line="+42"/>
<location line="+427"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+23"/>
<location line="+26"/>
<location line="+23"/>
<location line="+23"/>
<location filename="../rpcconsole.cpp" line="+494"/>
<source>N/A</source>
<translation>N/A</translation>
</message>
<message>
<location line="-1072"/>
<source>Client version</source>
<translation>Versión do cliente</translation>
</message>
<message>
<location line="-135"/>
<source>&Information</source>
<translation>&Información</translation>
</message>
<message>
<location line="+291"/>
<source>Startup time</source>
<translation>Tempo de arranque</translation>
</message>
<message>
<location line="-312"/>
<source>Gridcoin - Debug Console</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+335"/>
<source>Boost version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-44"/>
<source>Proof Of Research Difficulty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-194"/>
<source>Number of connections</source>
<translation>Número de conexións</translation>
</message>
<message>
<location line="+245"/>
<source>Block chain</source>
<translation>Cadea de bloques</translation>
</message>
<message>
<location line="-134"/>
<source>Gridcoin Core:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-104"/>
<source>Build date</source>
<translation>Data de construción</translation>
</message>
<message>
<location line="+201"/>
<source>Network:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-275"/>
<source>On testnet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+254"/>
<source>Current number of blocks</source>
<translation>Número actual de bloques</translation>
</message>
<message>
<location line="+94"/>
<source>Estimated total blocks</source>
<translation>Bloques totais estimados</translation>
</message>
<message>
<location line="+10"/>
<source>Open the Gridcoin debug log file from the current data directory. This can take a few seconds for large log files.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-301"/>
<source>Command-line options</source>
<translation type="unfinished">Opcións da liña de comandos</translation>
</message>
<message>
<location line="-33"/>
<source>Show the Gridcoin help message to get a list with possible Gridcoin command-line options.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>&Show</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>OpenSSL version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+177"/>
<source>Client name</source>
<translation>Nome do cliente</translation>
</message>
<message>
<location line="+7"/>
<source>Qt version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+44"/>
<source>Last block time</source>
<translation>Hora do último bloque</translation>
</message>
<message>
<location line="+96"/>
<source>&Open</source>
<translation>&Abrir</translation>
</message>
<message>
<location line="+277"/>
<source>&Peers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+67"/>
<source>Banned peers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+68"/>
<location filename="../rpcconsole.cpp" line="+380"/>
<source>Select a peer to view detailed information.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Whitelisted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Direction</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>User Agent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Services</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Starting Block</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Synced Headers</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Synced Blocks</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Ban Score</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Connection Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Last Send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Last Receive</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Sent</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Received</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Ping Time</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>The duration of a currently outstanding ping.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Ping Wait</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Min Ping</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Time Offset</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+43"/>
<source>&Console</source>
<translation>&Consola</translation>
</message>
<message>
<location line="+79"/>
<source>&Scraper</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-919"/>
<source>&Network Traffic</source>
<translation>&Tráfico de Rede</translation>
</message>
<message>
<location line="+52"/>
<source>&Clear</source>
<translation>&Limpar</translation>
</message>
<message>
<location line="+13"/>
<source>Totals</source>
<translation>Totais</translation>
</message>
<message>
<location line="+64"/>
<source>In:</source>
<translation>Dentro:</translation>
</message>
<message>
<location line="+80"/>
<source>Out:</source>
<translation>Fóra:</translation>
</message>
<message>
<location line="-353"/>
<source>Debug log file</source>
<translation>Arquivo de log de depuración</translation>
</message>
<message>
<location line="+1040"/>
<source>Clear console</source>
<translation>Limpar consola</translation>
</message>
<message>
<location filename="../rpcconsole.cpp" line="-549"/>
<source>&Disconnect</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<location line="+1"/>
<location line="+1"/>
<location line="+1"/>
<source>Ban for</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-3"/>
<source>1 &hour</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>1 &day</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>1 &week</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>1 &year</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+47"/>
<source>&Unban</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Yes</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>No</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+59"/>
<source>Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.</source>
<translation>Emprega as flechas arriba e abaixo para navegar polo historial, e <b>Ctrl-L</b> para limpar a pantalla.</translation>
</message>
<message>
<location line="+1"/>
<source>Type <b>help</b> for an overview of available commands.</source>
<translation>Escribe <b>axuda</b> para unha vista xeral dos comandos dispoñibles.</translation>
</message>
<message>
<location line="+118"/>
<source>%1 B</source>
<translation>%1 B</translation>
</message>
<message>
<location line="+2"/>
<source>%1 KB</source>
<translation>%1 KB</translation>
</message>
<message>
<location line="+2"/>
<source>%1 MB</source>
<translation>%1 MB</translation>
</message>
<message>
<location line="+2"/>
<source>%1 GB</source>
<translation>%1 GB</translation>
</message>
<message>
<location line="+7"/>
<source>%1 m</source>
<translation type="unfinished">%1 m</translation>
</message>
<message>
<location line="+5"/>
<source>%1 h</source>
<translation type="unfinished">%1 h</translation>
</message>
<message>
<location line="+2"/>
<source>%1 h %2 m</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+125"/>
<source>(node id: %1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>via %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<location line="+1"/>
<source>never</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Inbound</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source>Outbound</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<location line="+6"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-308"/>
<source>Welcome to the Gridcoin RPC console! </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherModel</name>
<message>
<location filename="../researcher/researchermodel.cpp" line="+113"/>
<source>Beacon is active.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Balance too low to send a beacon contract.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Beacon private key missing or invalid.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Current beacon is not renewable yet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Unable to send beacon transaction. See debug.log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Unlock wallet fully to send a beacon transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>No active beacon.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>No CPID detected.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Zero magnitude in the last superblock.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Pending beacon is awaiting network confirmation.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Beacon expires soon. Renew immediately.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Beacon eligible for renewal.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Waiting for data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+267"/>
<source>Not whitelisted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Not attached</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizard</name>
<message>
<location filename="../forms/researcherwizard.ui" line="+20"/>
<source>Researcher Configuration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../researcher/researcherwizard.cpp" line="+93"/>
<source>&Start Over</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardAuthPage</name>
<message>
<location filename="../forms/researcherwizardauthpage.ui" line="+20"/>
<location line="+3"/>
<source>Beacon Verification</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Gridcoin needs to verify your BOINC account CPID. Please follow the instructions below to change your BOINC account username. The network needs 24 to 48 hours to verify a new CPID.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+27"/>
<source>1. Sign in to your account at the website for a whitelisted BOINC project.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>2. Visit the settings page to change your username. Many projects label it as "other account info".</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>3. Change your username to the following verification code:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+55"/>
<source>Copy the verification code to the system clipboard</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Copy</source>
<translation type="unfinished">&Copiar</translation>
</message>
<message>
<location line="+26"/>
<source>4. Some projects will not export your statistics by default. If available, enable the privacy setting that gives consent to the project to export your statistics data. Many projects place this setting on the "Preferences for this Project" page and label it as "Do you consent to exporting your data to BOINC statistics aggregation web sites?"</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>5. Wait 24 to 48 hours for the verification process to finish (beacon status will change to "active").</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>6. After that, you may change the username back to your preference.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+32"/>
<source><html>
<head/>
<body>
<h4 style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<span style=" font-size:medium; font-weight:600;">Remember:</span>
</h4>
<ul style="margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 0;">
<li style=" margin-top:6px; margin-bottom:0px; margin-left:15px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The network only needs to verify the code above at a single whitelisted BOINC project even when you participate in multiple projects. </li>
<li style=" margin-top:6px; margin-bottom:0px; margin-left:15px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">The verification code expires after three days pass. </li>
<li style=" margin-top:6px; margin-bottom:0px; margin-left:15px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A beacon expires after six months pass. </li><li style=" margin-top:6px; margin-bottom:0px; margin-left:15px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">A beacon becomes eligible for renewal after five months pass. The wallet will remind you to renew the beacon. </li>
<li style=" margin-top:6px; margin-bottom:12px; margin-left:15px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">You will not need to change your username again to renew a beacon unless it expires. </li>
</ul>
</body>
</html></source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardBeaconPage</name>
<message>
<location filename="../forms/researcherwizardbeaconpage.ui" line="+20"/>
<location line="+3"/>
<source>Beacon Advertisement</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>A beacon links your BOINC accounts to your wallet. After sending a beacon, the network tracks your BOINC statistics to calculate research rewards.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+78"/>
<source>&Advertise Beacon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+122"/>
<source>Press "Next" to continue.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardEmailPage</name>
<message>
<location filename="../forms/researcherwizardemailpage.ui" line="+20"/>
<location line="+3"/>
<source>BOINC Email Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Enter the email address that you use for your BOINC project accounts. Gridcoin uses this email address to find BOINC projects on your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+24"/>
<source>Email Address:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+30"/>
<source>The wallet will never transmit your email address.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardInvestorPage</name>
<message>
<location filename="../forms/researcherwizardinvestorpage.ui" line="+20"/>
<source>Summary</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+61"/>
<source>Investor Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>You opted out of research rewards and will earn staking rewards only.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Press "Start Over" if you want to switch modes.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardModeDetailPage</name>
<message>
<location filename="../forms/researcherwizardmodedetailpage.ui" line="+20"/>
<source>Select Researcher Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<source>How can I participate?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source><html>
<head/>
<body>
<p>You can participate as either a miner or investor. <span style=" font-weight:600;">Miners</span> earn Gridcoin by participating in whitelisted BOINC projects. To redeem their rewards, miners must stake blocks. <span style=" font-weight:600;">Solo Miners</span> stake blocks on their own which typically requires a balance of at least 5000 GRC. <span style=" font-weight:600;">Pool Miners</span> avoid this upfront investment by letting a third party (the pool) stake blocks on their behalf. Pool mining is recommended for new users with a low initial balance. <span style=" font-weight:600;">Investors</span> own Gridcoin but do not participate in BOINC mining. By using their balance to stake blocks, investors help to secure the network and are rewarded 10 GRC per block.</p>
</body>
</html></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+52"/>
<source>Earn 10 GRC Block Reward</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Ability to Vote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Decentralized</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Helps Secure Network</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Keep 100% of Rewards</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Earn BOINC Rewards</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>No Upfront Investment</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+22"/>
<source>My Choice:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>BOINC Leaderboards</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+85"/>
<source>Pool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+91"/>
<source>Solo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+78"/>
<source>Investor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+88"/>
<source>Pool Only</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardModePage</name>
<message>
<location filename="../forms/researcherwizardmodepage.ui" line="+20"/>
<source>Select Researcher Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+67"/>
<source>How would you like to participate?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Solo</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Pool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+49"/>
<source>Investor</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Help me choose...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardPoolPage</name>
<message>
<location filename="../forms/researcherwizardpoolpage.ui" line="+20"/>
<source>Summary</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+61"/>
<source>Pool Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>In this mode, a pool will take care of staking research rewards for you. Your wallet can still earn standard staking rewards on your balance. You do not need a BOINC account, CPID, or beacon. Please choose a pool and follow the instructions on the website to sign up and connect the pool's account manager to BOINC:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+54"/>
<source>grcpool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Arikado Pool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Website URL</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+31"/>
<source>As you sign up, the pool may ask for a payment address to send earnings to. Press the button below to generate an address.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>New &Address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+41"/>
<source>&Copy</source>
<translation type="unfinished">&Copiar</translation>
</message>
<message>
<location line="+22"/>
<source>Press "Next" when you are done.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../researcher/researcherwizardpoolpage.cpp" line="+86"/>
<source>Address Label</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Label:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Pool Receiving Address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardPoolSummaryPage</name>
<message>
<location filename="../forms/researcherwizardpoolsummarypage.ui" line="+20"/>
<source>BOINC CPID Detection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+61"/>
<source>Pool Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>BOINC Folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Pool Status:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+82"/>
<source>Re-scan the BOINC projects on your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Refresh</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../researcher/researcherwizardpoolsummarypage.cpp" line="+79"/>
<source>Pool projects detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>No pool projects detected</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardProjectsPage</name>
<message>
<location filename="../forms/researcherwizardprojectspage.ui" line="+20"/>
<location line="+3"/>
<source>BOINC CPID Detection</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Gridcoin scans the BOINC projects on your computer to find an eligible cross-project identifier (CPID). The network tracks CPIDs to allocate research rewards.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+87"/>
<source>Email Address:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>BOINC Folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Selected CPID:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+82"/>
<source>Re-scan the BOINC projects on your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Refresh</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../researcher/researcherwizardprojectspage.cpp" line="+63"/>
<source>An error occurred while saving the email address to the configuration file. Please see debug.log for details.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ResearcherWizardSummaryPage</name>
<message>
<location filename="../forms/researcherwizardsummarypage.ui" line="+20"/>
<source>Researcher Summary</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>S&ummary</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+129"/>
<location filename="../researcher/researcherwizardsummarypage.cpp" line="+124"/>
<source>Everything looks good.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+34"/>
<source>Review Beacon Verification</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+104"/>
<source>Status:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Magnitude:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Pending Reward:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+123"/>
<source>Beacon:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Age:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Expires:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Address:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+47"/>
<source>&Renew</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+45"/>
<source>&Projects</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>Email Address:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>BOINC Folder:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Selected CPID:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+82"/>
<source>Re-scan the BOINC projects on your computer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>&Refresh</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../researcher/researcherwizardsummarypage.cpp" line="-9"/>
<source>Beacon awaiting confirmation.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Beacon renewal available.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Waiting for magnitude.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsDialog</name>
<message>
<location filename="../forms/sendcoinsdialog.ui" line="+14"/>
<location filename="../sendcoinsdialog.cpp" line="+176"/>
<location line="+5"/>
<location line="+5"/>
<location line="+5"/>
<location line="+6"/>
<location line="+5"/>
<location line="+5"/>
<source>Send Coins</source>
<translation>Moedas Enviadas</translation>
</message>
<message>
<location line="+67"/>
<source>Coin Control Features</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<source>Inputs...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>automatically selected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Insufficient funds!</source>
<translation>Fondos insuficientes</translation>
</message>
<message>
<location line="+10"/>
<source>Reset</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+80"/>
<source>Quantity:</source>
<translation>Cantidade:</translation>
</message>
<message>
<location line="+16"/>
<location line="+26"/>
<source>0</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-13"/>
<source>Bytes:</source>
<translation>Bytes:</translation>
</message>
<message>
<location line="+42"/>
<source>Amount:</source>
<translation>Importe:</translation>
</message>
<message>
<location line="+16"/>
<location line="+68"/>
<location line="+68"/>
<location line="+23"/>
<source>0.00 GRC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-149"/>
<source>Priority:</source>
<translation>Prioridade:</translation>
</message>
<message>
<location line="+13"/>
<source>medium</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>Fee:</source>
<translation>Pago:</translation>
</message>
<message>
<location line="+26"/>
<source>Low Output:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>no</source>
<translation type="unfinished">non</translation>
</message>
<message>
<location line="+29"/>
<source>After Fee:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+26"/>
<source>Change</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+44"/>
<source>custom change address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+141"/>
<source>Remove all transaction fields</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+47"/>
<source>123.456 GRC</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-70"/>
<source>Send to multiple recipients at once</source>
<translation>Enviar a múltiples receptores á vez</translation>
</message>
<message>
<location line="+3"/>
<source>Add &Recipient</source>
<translation>Engadir &Receptor</translation>
</message>
<message>
<location line="+23"/>
<source>Clear &All</source>
<translation>Limpar &Todo</translation>
</message>
<message>
<location line="+28"/>
<source>Balance:</source>
<translation>Balance:</translation>
</message>
<message>
<location line="+47"/>
<source>Confirm the send action</source>
<translation>Confirmar a acción de envío</translation>
</message>
<message>
<location line="+3"/>
<source>S&end</source>
<translation>&Enviar</translation>
</message>
<message>
<location line="-206"/>
<source>Enter a Gridcoin address (e.g. S67nL4vELWwdDVzjgtEP4MxryarTZ9a8GB)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../sendcoinsdialog.cpp" line="-164"/>
<source>Copy quantity</source>
<translation>Copiar cantidade</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Copiar cantidade</translation>
</message>
<message>
<location line="+1"/>
<source>Copy fee</source>
<translation>Copiar pago</translation>
</message>
<message>
<location line="+1"/>
<source>Copy after fee</source>
<translation>Copiar despóis do pago</translation>
</message>
<message>
<location line="+1"/>
<source>Copy bytes</source>
<translation>Copiar bytes</translation>
</message>
<message>
<location line="+1"/>
<source>Copy priority</source>
<translation>Copiar prioridade</translation>
</message>
<message>
<location line="+1"/>
<source>Copy low output</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Copy change</source>
<translation>Copiar cambio</translation>
</message>
<message>
<location line="+91"/>
<source><b>%1</b> to %2 (%3)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Confirm send coins</source>
<translation>Confirmar envío de moedas</translation>
</message>
<message>
<location line="+1"/>
<source>Are you sure you want to send %1?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+0"/>
<source> and </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+29"/>
<source>The recipient address is not valid, please recheck.</source>
<translation>A dirección de recepción non é válida, por favor compróbea.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount to pay must be larger than 0.</source>
<translation>A cantidade a pagar debe ser maior que 0.</translation>
</message>
<message>
<location line="+5"/>
<source>The amount exceeds your balance.</source>
<translation>A cantidade sobrepasa o teu balance.</translation>
</message>
<message>
<location line="+5"/>
<source>The total exceeds your balance when the %1 transaction fee is included.</source>
<translation>O total sobrepasa o teu balance cando se inclúe a tarifa de transacción %1.</translation>
</message>
<message>
<location line="+6"/>
<source>Duplicate address found, can only send to each address once per send operation.</source>
<translation>Atopouse dirección duplicada, so se pode enviar a cada dirección unha vez por operación.</translation>
</message>
<message>
<location line="+5"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+266"/>
<source>WARNING: Invalid Gridcoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>(no label)</source>
<translation>(sen etiqueta)</translation>
</message>
<message>
<location line="+4"/>
<source>WARNING: unknown change address</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SendCoinsEntry</name>
<message>
<location filename="../forms/sendcoinsentry.ui" line="+155"/>
<source>A&mount:</source>
<translation>&Cantidade:</translation>
</message>
<message>
<location line="-106"/>
<source>Pay &To:</source>
<translation>Pagar &A:</translation>
</message>
<message>
<location line="+93"/>
<source>&Label:</source>
<translation>&Etiqueta:</translation>
</message>
<message>
<location line="-56"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="+7"/>
<source>Paste address from clipboard</source>
<translation>Pegar dirección dende portapapeis</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+23"/>
<source>Message:</source>
<translation>Mensaxe:</translation>
</message>
<message>
<location line="-112"/>
<source>Form</source>
<translation type="unfinished">Formulario</translation>
</message>
<message>
<location line="+23"/>
<location line="+3"/>
<source>Enter a label for this address to add it to your address book</source>
<translation>Introduce unha etiqueta para esta dirección para engadila ao teu libro de direccións</translation>
</message>
<message>
<location line="+27"/>
<source>The address to send the payment to (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<source>Choose address from address book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+30"/>
<source>Remove this recipient</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+66"/>
<source>Send Custom Message to a Gridcoin Recipient</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-103"/>
<source>Enter a Gridcoin address (e.g. S67nL4vELWwdDVzjgtEP4MxryarTZ9a8GB)</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SignVerifyMessageDialog</name>
<message>
<location filename="../forms/signverifymessagedialog.ui" line="+14"/>
<source>Signatures - Sign / Verify a Message</source>
<translation>Sinaturas - Asinar / Verificar unha Mensaxe</translation>
</message>
<message>
<location line="+13"/>
<source>&Sign Message</source>
<translation>&Asinar Mensaxe</translation>
</message>
<message>
<location line="+6"/>
<source>You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.</source>
<translation>Podes asinar mensaxes coas túas direccións para probar que ti as posees. Ten conta de non asinar nada vago, xa que hai ataques de phishing que tentarán que asines coa túa identidade por riba deles. Asina únicamente declaracións totalmente detalladas coas que esteas de acordo.</translation>
</message>
<message>
<location line="+18"/>
<source>The address to sign the message with (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+13"/>
<location line="+198"/>
<source>Choose an address from the address book</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-113"/>
<source>Sign the message to prove you own this Gridcoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+79"/>
<source>Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.</source>
<translation>Introduce a dirección coa que asinar, a mensaxe (asegúrate de copiar exactamente os saltos de liña, espacios, tabulacións, etc.) e a sinatura debaixo para verificar a mensaxe. Ten coidado de non ler máis na sinatura do que hai no mensaxe asinado mesmo, a fin de evitar ser cazado nun ataque de home no medio.</translation>
</message>
<message>
<location line="+21"/>
<source>The address the message was signed with (e.g. Sjz75uKHzUQJnSdzvpiigEGxseKkDhQToX)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+47"/>
<source>Verify the message to ensure it was signed with the specified Gridcoin address</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-222"/>
<location line="+198"/>
<source>Alt+A</source>
<translation>Alt+A</translation>
</message>
<message>
<location line="-188"/>
<source>Paste address from clipboard</source>
<translation>Pegar dirección dende portapapeis</translation>
</message>
<message>
<location line="+10"/>
<source>Alt+P</source>
<translation>Alt+P</translation>
</message>
<message>
<location line="+12"/>
<source>Enter the message you want to sign here</source>
<translation>Introduce a mensaxe que queres asinar aquí</translation>
</message>
<message>
<location line="+22"/>
<source>Copy the current signature to the system clipboard</source>
<translation>Copiar a sinatura actual ao portapapeis do sistema</translation>
</message>
<message>
<location line="+24"/>
<source>Sign &Message</source>
<translation>Asinar &Mensaxe</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all sign message fields</source>
<translation>Restaurar todos os campos de sinatura de mensaxe</translation>
</message>
<message>
<location line="+3"/>
<location line="+147"/>
<source>Clear &All</source>
<translation>Limpar &Todo</translation>
</message>
<message>
<location line="-94"/>
<location line="+77"/>
<source>&Verify Message</source>
<translation>&Verificar Mensaxe</translation>
</message>
<message>
<location line="+14"/>
<source>Reset all verify message fields</source>
<translation>Restaurar todos os campos de verificación de mensaxe</translation>
</message>
<message>
<location line="-256"/>
<location line="+198"/>
<source>Enter a Gridcoin address (e.g. S67nL4vELWwdDVzjgtEP4MxryarTZ9a8GB)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-134"/>
<source>Click "Sign Message" to generate signature</source>
<translation>Click en "Asinar Mensaxe" para xerar sinatura</translation>
</message>
<message>
<location line="+166"/>
<source>Enter Gridcoin signature</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../signverifymessagedialog.cpp" line="+105"/>
<location line="+81"/>
<source>The entered address is invalid.</source>
<translation>A dirección introducida é inválida.</translation>
</message>
<message>
<location line="-81"/>
<location line="+8"/>
<location line="+73"/>
<location line="+8"/>
<source>Please check the address and try again.</source>
<translation>Por favor comproba a dirección e proba de novo.</translation>
</message>
<message>
<location line="-81"/>
<location line="+81"/>
<source>The entered address does not refer to a key.</source>
<translation>A dirección introducida non se refire a ninguna clave.</translation>
</message>
<message>
<location line="-73"/>
<source>Wallet unlock was cancelled.</source>
<translation>Cancelouse o desbloqueo do moedeiro.</translation>
</message>
<message>
<location line="+8"/>
<source>Private key for the entered address is not available.</source>
<translation>A clave privada da dirección introducida non está dispoñible.</translation>
</message>
<message>
<location line="+12"/>
<source>Message signing failed.</source>
<translation>Fallou a sinatura da mensaxe.</translation>
</message>
<message>
<location line="+5"/>
<source>Message signed.</source>
<translation>Mensaxe asinada.</translation>
</message>
<message>
<location line="+59"/>
<source>The signature could not be decoded.</source>
<translation>A sinatura non puido ser decodificada.</translation>
</message>
<message>
<location line="+0"/>
<location line="+13"/>
<source>Please check the signature and try again.</source>
<translation>Por favor revise a sinatura e probe de novo.</translation>
</message>
<message>
<location line="+0"/>
<source>The signature did not match the message digest.</source>
<translation>A sinatura non coincide co resumo da mensaxe.</translation>
</message>
<message>
<location line="+7"/>
<source>Message verification failed.</source>
<translation>A verificación da mensaxe fallou.</translation>
</message>
<message>
<location line="+5"/>
<source>Message verified.</source>
<translation>Mensaxe verificada.</translation>
</message>
</context>
<context>
<name>TransactionDesc</name>
<message numerus="yes">
<location filename="../transactiondesc.cpp" line="+35"/>
<source>Open for %n more block(s)</source>
<translation type="unfinished">
<numerusform>Abrir para %n bloque máis</numerusform>
<numerusform>Abrir para %n bloques máis</numerusform>
</translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Aberto ata %1</translation>
</message>
<message>
<location line="+8"/>
<source>conflicted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>%1/offline</source>
<translation>%1/fóra de liña</translation>
</message>
<message>
<location line="+3"/>
<source>%1/unconfirmed</source>
<translation>%1/sen confirmar</translation>
</message>
<message>
<location line="+3"/>
<source>%1 confirmations</source>
<translation>%1 confirmacións</translation>
</message>
<message>
<location line="+38"/>
<source>Status</source>
<translation>Estado</translation>
</message>
<message>
<location line="+5"/>
<source>, has not been successfully broadcast yet</source>
<translation>, non foi propagado con éxito todavía</translation>
</message>
<message numerus="yes">
<location line="+3"/>
<source>, broadcast through %n node(s)</source>
<translation>
<numerusform>, propagado a % nodo</numerusform>
<numerusform>, propagado a % nodos</numerusform>
</translation>
</message>
<message>
<location line="+4"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+4"/>
<location line="+5"/>
<source>Source</source>
<translation>Orixe</translation>
</message>
<message>
<location line="-5"/>
<source>Generated in CoinBase</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>MINED - POS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>MINED - POR</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>MINED - ORPHANED</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>MINED - UNKNOWN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<location line="+18"/>
<source>From</source>
<translation>Dende</translation>
</message>
<message>
<location line="+0"/>
<source>unknown</source>
<translation>descoñecido</translation>
</message>
<message>
<location line="+1"/>
<location line="+25"/>
<location line="+63"/>
<source>To</source>
<translation>A</translation>
</message>
<message>
<location line="-84"/>
<location line="+3"/>
<source>own address</source>
<translation>dirección propia</translation>
</message>
<message>
<location line="-3"/>
<source>label</source>
<translation>etiqueta</translation>
</message>
<message>
<location line="+40"/>
<location line="+14"/>
<location line="+50"/>
<location line="+20"/>
<location line="+63"/>
<source>Credit</source>
<translation>Crédito</translation>
</message>
<message numerus="yes">
<location line="-144"/>
<source>matures in %n more block(s)</source>
<translation>
<numerusform>madura nun bloque máis</numerusform>
<numerusform>madura en %n bloques máis</numerusform>
</translation>
</message>
<message>
<location line="+3"/>
<source>not accepted</source>
<translation>non aceptado</translation>
</message>
<message>
<location line="+48"/>
<location line="+9"/>
<location line="+16"/>
<location line="+63"/>
<source>Debit</source>
<translation>Débito</translation>
</message>
<message>
<location line="-72"/>
<source>Transaction fee</source>
<translation>Tarifa de transacción</translation>
</message>
<message>
<location line="+18"/>
<source>Net amount</source>
<translation>Cantidade neta</translation>
</message>
<message>
<location line="+4"/>
<location line="+20"/>
<source>Message</source>
<translation>Mensaxe</translation>
</message>
<message>
<location line="-17"/>
<source>Comment</source>
<translation>Comentario</translation>
</message>
<message>
<location line="+2"/>
<source>TX ID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<location line="+3"/>
<source>Block Hash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Transaction Stake Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+18"/>
<source>Transaction Debits/Credits</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Transaction Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Transaction Inputs</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-22"/>
<source>Gridcoin generated coins must mature 110 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-218"/>
<source>POS SIDE STAKE RECEIVED</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>POR SIDE STAKE RECEIVED</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>POS SIDE STAKE SENT</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>POR SIDE STAKE SENT</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>SUPERBLOCK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+251"/>
<source>Amount</source>
<translation>Cantidade</translation>
</message>
<message>
<location line="+1"/>
<source>true</source>
<translation>verdadeiro</translation>
</message>
<message>
<location line="+0"/>
<source>false</source>
<translation>falso</translation>
</message>
</context>
<context>
<name>TransactionDescDialog</name>
<message>
<location filename="../forms/transactiondescdialog.ui" line="+20"/>
<source>Transaction details</source>
<translation>Detalles de transacción</translation>
</message>
<message>
<location line="+9"/>
<source>This pane shows a detailed description of the transaction</source>
<translation>Este panel amosa unha descripción detallada da transacción</translation>
</message>
<message>
<location line="+25"/>
<source>C&lose</source>
<translation type="unfinished">&Pechar</translation>
</message>
</context>
<context>
<name>TransactionTableModel</name>
<message>
<location filename="../transactiontablemodel.cpp" line="+264"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+0"/>
<source>Type</source>
<translation>Tipo</translation>
</message>
<message>
<location line="+0"/>
<source>Address</source>
<translation>Dirección</translation>
</message>
<message>
<location line="+0"/>
<source>Amount</source>
<translation>Cantidade</translation>
</message>
<message numerus="yes">
<location line="+59"/>
<source>Open for %n more block(s)</source>
<translation>
<numerusform>Abrir para %n bloque máis</numerusform>
<numerusform>Abrir para %n bloques máis</numerusform>
</translation>
</message>
<message>
<location line="+3"/>
<source>Open until %1</source>
<translation>Aberto ata %1</translation>
</message>
<message>
<location line="+3"/>
<source>Offline</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Unconfirmed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Confirming (%1 of %2 recommended confirmations)<br></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Confirmed (%1 confirmations)</source>
<translation>Confirmado (%1 confirmacións)</translation>
</message>
<message>
<location line="+3"/>
<source>Conflicted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Immature (%1 confirmations, will be available after %2)<br></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>This block was not received by any other nodes<br> and will probably not be accepted!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Generated but not accepted</source>
<translation>Xerado pero non aceptado</translation>
</message>
<message>
<location line="+44"/>
<source>Received with</source>
<translation>Recibido con</translation>
</message>
<message>
<location line="+2"/>
<source>Received from</source>
<translation>Recibido de</translation>
</message>
<message>
<location line="+3"/>
<source>Sent to</source>
<translation>Enviado a</translation>
</message>
<message>
<location line="+2"/>
<source>Payment to yourself</source>
<translation>Pago a ti mesmo</translation>
</message>
<message>
<location line="+8"/>
<source>MINED - POS</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>MINED - POR</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>MINED - ORPHANED</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>POS SIDE STAKE RECEIVED</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>POR SIDE STAKE RECEIVED</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>POS SIDE STAKE SENT</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>POR SIDE STAKE SENT</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>MINED - SUPERBLOCK</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>MINED - UNKNOWN</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Beacon Advertisement</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Poll</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Vote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Message</source>
<translation type="unfinished">Mensaxe</translation>
</message>
<message>
<location line="+71"/>
<source>(n/a)</source>
<translation>(n/a)</translation>
</message>
<message>
<location line="+190"/>
<source>Transaction status. Hover over this field to show number of confirmations.</source>
<translation>Estado da transacción. Pasa por riba deste campo para amosar o número de confirmacións.</translation>
</message>
<message>
<location line="+2"/>
<source>Date and time that the transaction was received.</source>
<translation>Data e hora na que foi recibida a transacción.</translation>
</message>
<message>
<location line="+2"/>
<source>Type of transaction.</source>
<translation>Tipo de transacción.</translation>
</message>
<message>
<location line="+2"/>
<source>Destination address of transaction.</source>
<translation>Dirección de destino da transacción.</translation>
</message>
<message>
<location line="+2"/>
<source>Amount removed from or added to balance.</source>
<translation>Cantidade borrada ou engadida no balance.</translation>
</message>
</context>
<context>
<name>TransactionView</name>
<message>
<location filename="../transactionview.cpp" line="+55"/>
<location line="+16"/>
<source>All</source>
<translation>Todo</translation>
</message>
<message>
<location line="-15"/>
<source>Today</source>
<translation>Hoxe</translation>
</message>
<message>
<location line="+1"/>
<source>This week</source>
<translation>Esta semana</translation>
</message>
<message>
<location line="+1"/>
<source>This month</source>
<translation>Este mes</translation>
</message>
<message>
<location line="+1"/>
<source>Last month</source>
<translation>O último mes</translation>
</message>
<message>
<location line="+1"/>
<source>This year</source>
<translation>Este ano</translation>
</message>
<message>
<location line="+1"/>
<source>Range...</source>
<translation>Periodo...</translation>
</message>
<message>
<location line="+11"/>
<source>Received with</source>
<translation>Recibido con</translation>
</message>
<message>
<location line="+2"/>
<source>Sent to</source>
<translation>Enviado a</translation>
</message>
<message>
<location line="+2"/>
<source>To yourself</source>
<translation>A ti mesmo</translation>
</message>
<message>
<location line="+1"/>
<source>Mined</source>
<translation>Minado</translation>
</message>
<message>
<location line="+1"/>
<source>Other</source>
<translation>Outro</translation>
</message>
<message>
<location line="+6"/>
<source>Enter address or label to search</source>
<translation>Introduce dirección ou etiqueta para buscar</translation>
</message>
<message>
<location line="+5"/>
<source>Min amount</source>
<translation>Cantidade mínima</translation>
</message>
<message>
<location line="+34"/>
<source>Copy address</source>
<translation>Copiar dirección</translation>
</message>
<message>
<location line="+1"/>
<source>Copy label</source>
<translation>Copiar etiqueta</translation>
</message>
<message>
<location line="+1"/>
<source>Copy amount</source>
<translation>Copiar cantidade</translation>
</message>
<message>
<location line="+1"/>
<source>Copy transaction ID</source>
<translation>Copiar ID de transacción</translation>
</message>
<message>
<location line="+1"/>
<source>Edit label</source>
<translation>Modificar etiqueta</translation>
</message>
<message>
<location line="+1"/>
<source>Show transaction details</source>
<translation>Amosar detalles da transacción</translation>
</message>
<message>
<location line="+144"/>
<source>Export Transaction Data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Comma separated file (*.csv)</source>
<translation>Arquivo separado por comas (*.csv)</translation>
</message>
<message>
<location line="+8"/>
<source>Confirmed</source>
<translation>Confirmado</translation>
</message>
<message>
<location line="+1"/>
<source>Date</source>
<translation>Data</translation>
</message>
<message>
<location line="+1"/>
<source>Type</source>
<translation>Tipo</translation>
</message>
<message>
<location line="+1"/>
<source>Label</source>
<translation>Etiqueta</translation>
</message>
<message>
<location line="+1"/>
<source>Address</source>
<translation>Dirección</translation>
</message>
<message>
<location line="+1"/>
<source>Amount</source>
<translation>Cantidade</translation>
</message>
<message>
<location line="+1"/>
<source>ID</source>
<translation>ID</translation>
</message>
<message>
<location line="+4"/>
<source>Error exporting</source>
<translation type="unfinished">Error exportando</translation>
</message>
<message>
<location line="+0"/>
<source>Could not write to file %1.</source>
<translation type="unfinished">Non se puido escribir a arquivo %1</translation>
</message>
<message>
<location line="+100"/>
<source>Range:</source>
<translation>Periodo:</translation>
</message>
<message>
<location line="+8"/>
<source>to</source>
<translation>a</translation>
</message>
</context>
<context>
<name>VotingChartDialog</name>
<message>
<location filename="../votingdialog.cpp" line="-477"/>
<source>Poll Results</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Q: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Discussion URL: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+30"/>
<source>Chart</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Answer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Shares</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>List</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-35"/>
<source>Best Answer: </source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VotingDialog</name>
<message>
<location line="-365"/>
<source>Active Polls (Right Click to Vote)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Filter: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Reload Polls</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Load History</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Create Poll</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+42"/>
<source>Press reload to load polls... This can take several minutes, and the wallet may not respond until finished.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+25"/>
<source>Recalculating voting weights... This can take several minutes, and the wallet may not respond until finished.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+36"/>
<source>Poll data is more than one hour old. Press reload to update... This can take several minutes, and the wallet may not respond until finished.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>No polls !</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VotingTableModel</name>
<message>
<location line="-463"/>
<source>#</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Title</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-1"/>
<source>Expiration</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Share Type</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source># Voters</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Total Shares</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source>Best Answer</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+126"/>
<source>Row Number.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Title.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Expiration.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Share Type.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Total Participants.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Total Shares.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Best Answer.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>VotingVoteDialog</name>
<message>
<location line="+629"/>
<source>PlaceVote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Q: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Discussion URL: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Response Type: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Best Answer: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Vote</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+54"/>
<source>Poll not found.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Failed to load poll from disk</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Please unlock the wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Success. Vote will activate with the next block.</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>WalletModel</name>
<message>
<location filename="../walletmodel.cpp" line="+259"/>
<source>Sending...</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>bitcoin-core</name>
<message>
<location filename="../bitcoinstrings.cpp" line="+275"/>
<source>Options:</source>
<translation>Opcións:</translation>
</message>
<message>
<location line="+59"/>
<source>Specify data directory</source>
<translation>Especificar directorio de datos</translation>
</message>
<message>
<location line="-149"/>
<source>Connect to a node to retrieve peer addresses, and disconnect</source>
<translation>Conectar a nodo para recuperar direccións de pares, e desconectar</translation>
</message>
<message>
<location line="+152"/>
<source>Specify your own public address</source>
<translation>Especificar a túa propia dirección pública</translation>
</message>
<message>
<location line="-184"/>
<source>Accept command line and JSON-RPC commands</source>
<translation>Aceptar liña de comandos e comandos JSON-RPC</translation>
</message>
<message>
<location line="+153"/>
<source>Run in the background as a daemon and accept commands</source>
<translation>Executar no fondo como un demo e aceptar comandos</translation>
</message>
<message>
<location line="-231"/>
<source>Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)</source>
<translation>Executar comando cando unha transacción do moedeiro cambia (%s no comando é substituído por TxID)</translation>
</message>
<message>
<location line="+90"/>
<source>Block creation options:</source>
<translation>Opcións de creación de bloque:</translation>
</message>
<message>
<location line="+46"/>
<source>Failed to listen on any port. Use -listen=0 if you want this.</source>
<translation>Fallou escoitar en calquera porto. Emprega -listen=0 se queres esto.</translation>
</message>
<message>
<location line="+121"/>
<source>Specify configuration file (default: gridcoinresearch.conf)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Specify wallet file (within data directory)</source>
<translation>Especificar arquivo do moedeiro (dentro do directorio de datos)</translation>
</message>
<message>
<location line="-24"/>
<source>Send trace/debug info to console instead of debug.log file</source>
<translation>Enviar traza/información de depuración á consola en lugar de ao arquivo debug.log</translation>
</message>
<message>
<location line="+11"/>
<source>Shrink debug.log file on client startup (default: 1 when no -debug)</source>
<translation>Recortar o arquivo debug.log ao arrancar o cliente (por defecto: 1 cando no-debug)</translation>
</message>
<message>
<location line="+50"/>
<source>Username for JSON-RPC connections</source>
<translation>Nome de usuario para conexións JSON-RPC</translation>
</message>
<message>
<location line="-92"/>
<source>Password for JSON-RPC connections</source>
<translation>Contrasinal para conexións JSON-RPC</translation>
</message>
<message>
<location line="-203"/>
<source>Execute command when the best block changes (%s in cmd is replaced by block hash)</source>
<translation>Executar comando cando o mellor bloque cambie (%s no comando é sustituído polo hash do bloque)</translation>
</message>
<message>
<location line="+79"/>
<source>Allow DNS lookups for -addnode, -seednode and -connect</source>
<translation>Permitir lookup de DNS para -addnote, -seednote e -connect</translation>
</message>
<message>
<location line="+91"/>
<source>Loading addresses...</source>
<translation>Cargando direccións...</translation>
</message>
<message>
<location line="-13"/>
<source>Invalid -proxy address: '%s'</source>
<translation>Dirección -proxy inválida: '%s'</translation>
</message>
<message>
<location line="+125"/>
<source>Unknown network specified in -onlynet: '%s'</source>
<translation>Rede descoñecida especificada en -onlynet: '%s'</translation>
</message>
<message>
<location line="-128"/>
<source>Insufficient funds</source>
<translation>Fondos insuficientes</translation>
</message>
<message>
<location line="+19"/>
<source>Loading block index...</source>
<translation>Cargando índice de bloques...</translation>
</message>
<message>
<location line="-96"/>
<source>Add a node to connect to and attempt to keep the connection open</source>
<translation>Engadir un nodo ao que conectarse e tentar manter a conexión aberta</translation>
</message>
<message>
<location line="+98"/>
<source>Loading wallet...</source>
<translation>Cargando moedeiro...</translation>
</message>
<message>
<location line="-77"/>
<source>Cannot downgrade wallet</source>
<translation>Non se pode desactualizar o moedeiro</translation>
</message>
<message>
<location line="+3"/>
<source>Cannot write default address</source>
<translation>Non se pode escribir a dirección por defecto</translation>
</message>
<message>
<location line="+125"/>
<source>Rescanning...</source>
<translation>Rescaneando...</translation>
</message>
<message>
<location line="-114"/>
<source>Done loading</source>
<translation>Carga completa</translation>
</message>
<message>
<location line="+12"/>
<source>Error</source>
<translation>Erro</translation>
</message>
<message>
<location line="+154"/>
<source>To use the %s option</source>
<translation>Empregar a opción %s</translation>
</message>
<message>
<location line="-342"/>
<source>%s, you must set a rpcpassword in the configuration file:
%s
It is recommended you use the following random password:
rpcuser=gridcoinrpc
rpcpassword=%s
(you do not need to remember this password)
The username and password MUST NOT be the same.
If the file does not exist, create it with owner-readable-only file permissions.
It is also recommended to set alertnotify so you are notified of problems;
for example: alertnotify=echo %%s | mail -s "Gridcoin Alert" [email protected]
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s</source>
<translation>Ocorreu un erro mentres se establecía o porto RPC %u para escoitar sobre IPv6, voltando a IPv4: %s</translation>
</message>
<message>
<location line="-2"/>
<source>An error occurred while setting up the RPC port %u for listening on IPv4: %s</source>
<translation>Ocorreu un erro mentres se establecía o porto RPC %u para escoitar sobre IPv4: %s</translation>
</message>
<message>
<location line="-21"/>
<location line="+1"/>
<source>None</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+33"/>
<source>Delete all wallet transactions and only recover those parts of the blockchain through -rescan on startup</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+58"/>
<source>Specify p2p connection timeout in seconds. This option determines the amount of time a peer may be inactive before the connection to it is dropped. (minimum: 1, default: 45)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+43"/>
<source>You must set rpcpassword=<password> in the configuration file:
%s
If the file does not exist, create it with owner-readable-only file permissions.</source>
<translation>Debes fixar rpcpassword=<contrasinal> no arquivo de configuración:
%s
Se o arquivo non existe, debes crealo con permisos de so lectura para o propietario.</translation>
</message>
<message>
<location line="+9"/>
<source>Alert: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Block Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Block not in index</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Block read failed</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Blocks Loaded</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Blocks Verified</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Boinc Reward</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>CPID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+9"/>
<source>Client Version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Difficulty</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>ERROR</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Eligible for Research Rewards</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Error: Wallet locked, unable to create transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Gridcoin version</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Height</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+12"/>
<source>Interest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Invalid amount for -peertimeout=<amount>: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Invalid team</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Is Superblock</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Loading banlist...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Low difficulty!; </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Magnitude</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Malformed CPID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Miner: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Organization</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+22"/>
<source>Print version and exit</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Project email mismatch</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+23"/>
<source>Set the number of threads to service RPC calls (default: 4)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+37"/>
<source>Unknown error</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Unknown</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Usage:</source>
<translation>Emprego:</translation>
</message>
<message>
<location line="-122"/>
<source>List commands</source>
<translation>Listar comandos</translation>
</message>
<message>
<location line="-28"/>
<source>Get help for a command</source>
<translation>Obter axuda para un comando</translation>
</message>
<message>
<location line="+4"/>
<source>Gridcoin</source>
<translation type="unfinished">Gridcoin</translation>
</message>
<message>
<location line="+132"/>
<source>This help message</source>
<translation>Esta mensaxe de axuda</translation>
</message>
<message>
<location line="-18"/>
<source>Specify pid file (default: gridcoind.pid)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-18"/>
<source>Set database cache size in megabytes (default: 25)</source>
<translation>Fixar tamaño da caché da base de datos en megabytes (por defecto: 25)</translation>
</message>
<message>
<location line="+1"/>
<source>Set database disk log size in megabytes (default: 100)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Specify connection timeout in milliseconds (default: 5000)</source>
<translation>Especificar tempo límite da conexión en milisegundos (por defecto: 5000)</translation>
</message>
<message>
<location line="-149"/>
<source>Connect through socks proxy</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+125"/>
<source>Select the version of socks proxy to use (4-5, default: 5)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+62"/>
<source>Use proxy to reach tor hidden services (default: same as -proxy)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-125"/>
<source>Listen for connections on <port> (default: 32749 or testnet: 32748)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Maintain at most <n> connections to peers (default: 125)</source>
<translation>Manter como moito <n> conexións con pares (por defecto: 125)</translation>
</message>
<message>
<location line="-77"/>
<source>Connect only to the specified node(s)</source>
<translation>Conectar so ao(s) nodo(s) especificado(s)</translation>
</message>
<message>
<location line="+89"/>
<source>Only connect to nodes in network <net> (IPv4, IPv6 or Tor)</source>
<translation>Conectar so a nodos na rede <net> (IPv4, IPv6 ou Tor)</translation>
</message>
<message>
<location line="-83"/>
<source>Discover own IP address (default: 1 when listening and no -externalip)</source>
<translation>Descobrir dirección IP propia (por defecto: 1 se á escoita e non -externalip)</translation>
</message>
<message>
<location line="-35"/>
<source>Accept connections from outside (default: 1 if no -proxy or -connect)</source>
<translation>Aceptar conexións de fóra (por defecto: 1 se non -proxy ou -connect)</translation>
</message>
<message>
<location line="+9"/>
<source>Bind to given address. Use [host]:port notation for IPv6</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+51"/>
<source>Find peers using DNS lookup (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-106"/>
<source>Sync time with other nodes. Disable if time on your system is precise e.g. syncing with NTP (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+247"/>
<source>Threshold for disconnecting misbehaving peers (default: 100)</source>
<translation>Umbral para desconectar pares con mal comportamento (por defecto: 100)</translation>
</message>
<message>
<location line="-272"/>
<source>Number of seconds to keep misbehaving peers from reconnecting (default: 86400)</source>
<translation>Número de segundos para manter sen reconectar aos pares con mal comportamento (por defecto: 86400)</translation>
</message>
<message>
<location line="-56"/>
<source>A poll with a yes/no/abstain response type cannot include any additional custom choices.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Cannot obtain a lock on data directory %s. %s is probably already running and using that directory.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Cannot obtain a lock on data directory %s. %s is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>DEPRECATED: Optional: Create a wallet backup every <n> blocks. Zero disables backups</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Disable CPID detection and do not participate in the research reward system</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Email address to use for CPID detection. Must match your BOINC account email</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+17"/>
<source>Optional: Create a wallet backup every <n> seconds. Zero disables backups (default: 86400)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Optional: URL for the snapshot.sha256 file (ex: https://sub.domain.com/location/snapshot.sha256)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Optional: URL for the snapshot.zip file (ex: https://sub.domain.com/location/snapshot.zip)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Optional: URL for the update version checks (ex: https://sub.domain.com/location/latest</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Path to the BOINC data directory for CPID detection when the BOINC client uses a non-default directory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>WARNING: A mandatory release is available. Please upgrade as soon as possible.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>WARNING: Blockchain data may be corrupt.
Gridcoin detected bad index entries. This may occur because of an unexpected exit or power failure.
Please exit Gridcoin, open the data directory, and delete:
- the blk****.dat files
- the txleveldb folder
Your wallet will re-download the blockchain. Your balance may appear incorrect until the synchronization finishes.
</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Warning: Ending this process after Stage 2 will result in syncing from 0 or an incomplete/corrupted blockchain.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+21"/>
<source>A poll choice cannot be empty.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Are you sure you want to cancel the snapshot operation?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Balance too low to create a contract.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>CPID Count</source>
<translation type="unfinished"></translation>
</message>
<message><|fim▁hole|> <location line="+1"/>
<source>CPID count polls are not supported.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Cancel snapshot operation?</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Cancel</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Cannot write to data directory '%s'; check permissions.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Click "Show Details" to view changes in latest update.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Could not clean up previous blockchain data.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Could not create transaction. See debug.log.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Download and apply latest snapshot</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Duplicate poll choice: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Duplicate response for poll choice: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Error loading %s: Wallet corrupted</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+8"/>
<source>Error: Transaction creation failed.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Exceeded the number of choices in the poll: %s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Failed to download snapshot.zip; See debug.log</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Fees Collected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>GB)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>GB/</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Github version: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Gridcoin Update Available</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+10"/>
<source>Initializing beacon registry from stored history...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Initializing local researcher context...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Initializing research reward accounting...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Insufficient funds.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+11"/>
<source>KB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+6"/>
<source>Loading beacon history...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Loading superblock cache...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Local version: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>MB/s</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Magnitude+Balance</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Magnitude-only polls are not supported.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)</source>
<translation>Máximo buffer por-conexión para recibir, <n>*1000 bytes (por defecto: 5000)</translation>
</message>
<message>
<location line="+1"/>
<source>Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)</source>
<translation>Máximo buffer por-conexión para enviar, <n>*1000 bytes (por defecto: 1000)</translation>
</message>
<message>
<location line="+2"/>
<source>Multiple Choice</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>N/A</source>
<translation type="unfinished">N/A</translation>
</message>
<message>
<location line="+1"/>
<source>No address contains %s GRC in %s UTXOs or fewer.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>No eligible outputs greater than 1 GRC.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>No wallet available.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Optional: Check for updates every <n> hours (default: 120, minimum: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Optional: Disable update checks by wallet</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Output extra debugging information.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Override automatic CPID detection with the specified CPID</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Participant Count</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Participant count polls are not supported.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Please enter a poll discussion website URL.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Please enter a poll title.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Please enter at least one response.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Please enter at least two poll choices.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll cannot contain more than %s choices.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll choice "%s" exceeds %s characters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll discussion URL cannot exceed %s characters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll duration cannot exceed %s days.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll duration must be at least %s days.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll has already finished.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll only allows a single choice.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll question cannot exceed %s characters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll signature failed. See debug.log.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Poll title cannot exceed %s characters.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Pool</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Quorum Hash</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Replaying contracts...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+4"/>
<source>Research reward system options:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>SHA256SUM of snapshot.zip does not match the server's SHA256SUM.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Send command to -server or gridcoinresearchd</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+14"/>
<source>Single Choice</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Skip pool CPID checks for staking nodes run by pool administrators</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Snapshot Process Complete!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Snapshot Process Has Begun.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Snapshot extraction failed! Cleaning up any extracted data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Snapshot operation canceled due to an invalid snapshot zip.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Snapshot operation canceled.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Snapshot operation successful!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Stage (1/4): Downloading snapshot.zip: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (1/4): Downloading snapshot.zip: Speed </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (2/4): Verify SHA256SUM of snapshot.zip</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (2/4): Verify SHA256SUM of snapshot.zip: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (3/4): Cleanup blockchain data</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (3/4): Cleanup blockchain data: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (4/4): Extracting snapshot.zip</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Stage (4/4): Extracting snapshot.zip: </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Staking Only - Investor Mode</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Staking Only - No Eligible Research Projects</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Staking Only - No active beacon</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Staking Only - Pool Detected</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Superblock Binary Size</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The wallet is now shutting down. Please restart your wallet.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>The wallet will now shutdown.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>This update is </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>Unknown poll response type.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unknown poll type.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Unknown poll weight type.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Update/Snapshot options:</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+5"/>
<source>Use UPnP to map the listening port (default: 1 when listening)</source>
<translation>Usar UPnP para mapear o porto de escoita (por defecto: 1 se á escoita)</translation>
</message>
<message>
<location line="+9"/>
<source>Yes/No/Abstain</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>"%s" is not a valid poll choice.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>leisure</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>mandatory</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>unknown</source>
<translation type="unfinished">descoñecido</translation>
</message>
<message>
<location line="-14"/>
<source>Use UPnP to map the listening port (default: 0)</source>
<translation>Usar UPnP para mapear o porto de escoita (por defecto: 0)</translation>
</message>
<message>
<location line="-157"/>
<source>Fee per KB to add to transactions you send</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-68"/>
<source>When creating transactions, ignore inputs with value less than this (default: 0.01)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+228"/>
<source>Use the test network</source>
<translation>Empregar a rede de proba</translation>
</message>
<message>
<location line="-75"/>
<source>Prepend debug output with timestamp</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+16"/>
<source>Send trace/debug info to debugger</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-232"/>
<source>Listen for JSON-RPC connections on <port> (default: 15715 or testnet: 25715)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+77"/>
<source>Allow JSON-RPC connections from specified IP address</source>
<translation>Permitir conexións JSON-RPC dende direccións IP especificadas</translation>
</message>
<message>
<location line="+153"/>
<source>Send commands to node running on <ip> (default: 127.0.0.1)</source>
<translation>Enviar comandos a nodo executando na <ip> (por defecto: 127.0.0.1)</translation>
</message>
<message>
<location line="-9"/>
<source>Require a confirmations for change (default: 0)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-249"/>
<source>Enforce transaction scripts to use canonical PUSH operators (default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+19"/>
<source>Execute command when a relevant alert is received (%s in cmd is replaced by message)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+294"/>
<source>Upgrade wallet to latest format</source>
<translation>Actualizar moedeiro ao formato máis recente</translation>
</message>
<message>
<location line="-47"/>
<source>Set key pool size to <n> (default: 100)</source>
<translation>Fixar tamaño do pool de claves a <n> (por defecto: 100)</translation>
</message>
<message>
<location line="-16"/>
<source>Rescan the block chain for missing wallet transactions</source>
<translation>Rescanear transaccións ausentes na cadea de bloques</translation>
</message>
<message>
<location line="-143"/>
<source>Attempt to recover private keys from a corrupt wallet.dat</source>
<translation>Tentar recuperar claves privadas dende un wallet.dat corrupto</translation>
</message>
<message>
<location line="-130"/>
<source>Acceptable ciphers (default: TLSv1.2+HIGH:TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!3DES:@STRENGTH)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+171"/>
<source>Error obtaining status.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+22"/>
<source>How many blocks to check at startup (default: 2500, 0 = all)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>How thorough the block verification is (0-6, default: 1)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+3"/>
<source>Imports blocks from external blk000?.dat file</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+20"/>
<source>Loading Network Averages...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+15"/>
<source>Maximum number of outbound connections (default: 8)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+7"/>
<source>No current polls</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+52"/>
<source>Set minimum block size in bytes (default: 0)</source>
<translation>Fixar tamaño mínimo de bloque en bytes (por defecto: 0)</translation>
</message>
<message>
<location line="-1"/>
<source>Set maximum block size in bytes (default: 250000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-219"/>
<source>Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+207"/>
<source>SSL options: (see the Bitcoin Wiki for SSL setup instructions)</source>
<translation>Opcións SSL: (ver ?a Wiki Bitcoin as instrucción de configuración de SSL)</translation>
</message>
<message>
<location line="+60"/>
<source>Use OpenSSL (https) for JSON-RPC connections</source>
<translation>Empregar OpenSSL (https) para conexións JSON-RPC</translation>
</message>
<message>
<location line="-53"/>
<source>Server certificate file (default: server.cert)</source>
<translation>Arquivo de certificado do servidor (por defecto: server.cert)</translation>
</message>
<message>
<location line="+1"/>
<source>Server private key (default: server.pem)</source>
<translation>Clave privada do servidor (por defecto: server.perm)</translation>
</message>
<message>
<location line="-78"/>
<source>Invalid amount for -paytxfee=<amount>: '%s'</source>
<translation>Cantidade inválida para -paytxfee=<cantidade>: '%s'</translation>
</message>
<message>
<location line="-110"/>
<source>Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.</source>
<translation>Precaución: -paytxfee está posto moi algo! Esta é a tarifa de transacción que ti pagarás se envías unha transacción.</translation>
</message>
<message>
<location line="+109"/>
<source>Invalid amount for -mininput=<amount>: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-9"/>
<source>Initialization sanity check failed. Gridcoin is shutting down.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+148"/>
<source>Wallet %s resides outside data directory %s.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-2"/>
<source>Verifying database integrity...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-319"/>
<source>Error initializing database environment %s! To recover, BACKUP THAT DIRECTORY, then remove everything from it except for wallet.dat.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+85"/>
<source>Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.</source>
<translation>Precaución: wallet.dat corrupto, datos salvagardados! O wallet.dat orixinal foi gardado como wallet.{timestamp}.bak en %s; se o teu balance ou transaccións son incorrectas deberías restauralas dende unha copia de seguridade.</translation>
</message>
<message>
<location line="+244"/>
<source>wallet.dat corrupt, salvage failed</source>
<translation>wallet.dat corrupto, fallou o gardado</translation>
</message>
<message>
<location line="-26"/>
<source>Unknown -socks proxy version requested: %i</source>
<translation>Versión solicitada de proxy -socks descoñecida: %i</translation>
</message>
<message>
<location line="-122"/>
<source>Invalid -tor address: '%s'</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-59"/>
<source>Cannot resolve -bind address: '%s'</source>
<translation>Non se pode resolver a dirección -bind: '%s'</translation>
</message>
<message>
<location line="+1"/>
<source>Cannot resolve -externalip address: '%s'</source>
<translation>Non se pode resolver dirección -externalip: '%s'</translation>
</message>
<message>
<location line="+62"/>
<source>Invalid amount for -reservebalance=<amount></source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-43"/>
<source>Error loading blkindex.dat</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Error loading wallet.dat: Wallet corrupted</source>
<translation>Erro cargando wallet.dat: Moedeiro corrupto</translation>
</message>
<message>
<location line="-62"/>
<source>Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.</source>
<translation>Precaución: erro lendo wallet.dat! Tódalas claves lidas correctamente, pero os datos de transacción ou as entradas do libro de direccións podrían estar ausentes ou incorrectos.</translation>
</message>
<message>
<location line="+63"/>
<source>Error loading wallet.dat: Wallet requires newer version of Gridcoin</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+175"/>
<source>Vote signature failed. See debug.log.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Wallet needed to be rewritten: restart Gridcoin to complete</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-179"/>
<source>Error loading wallet.dat</source>
<translation>Erro cargando wallet.dat</translation>
</message>
<message>
<location line="+27"/>
<source>Importing blockchain data file.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+1"/>
<source>Importing bootstrap blockchain data file.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-18"/>
<source>Error: could not start node</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-97"/>
<source>Unable to bind to %s on this computer. Gridcoin is probably already running.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+246"/>
<source>Unable to bind to %s on this computer (bind returned error %d, %s)</source>
<translation>Imposible enlazar con %s neste ordenador (enlace devolveu erro %d, %s)</translation>
</message>
<message>
<location line="-152"/>
<source>Error: Wallet locked, unable to create transaction </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+2"/>
<source>Error: Wallet unlocked for staking only, unable to create transaction.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-141"/>
<source>Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+137"/>
<source>Error: Transaction creation failed </source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+111"/>
<source>Sending...</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="-256"/>
<source>Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+183"/>
<source>Invalid amount</source>
<translation>Cantidade inválida</translation>
</message>
<message>
<location line="-107"/>
<source>Warning: Please check that your computer's date and time are correct! If your clock is wrong Gridcoin will not work properly.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location line="+244"/>
<source>Warning: Disk space is low!</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS><|fim▁end|> | |
<|file_name|>request.py<|end_file_name|><|fim▁begin|># urllib3/request.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ['RequestMethods']
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.connectionpool.HTTPConnectionPool` and
:class:`~urllib3.poolmanager.PoolManager`.
Provides behavior for making common types of HTTP request methods and
decides which type of request field encoding to use.
Specifically,
:meth:`.request_encode_url` is for sending requests whose fields are encoded
in the URL (such as GET, HEAD, DELETE).
:meth:`.request_encode_body` is for sending requests whose fields are
encoded in the *body* of the request using multipart or www-orm-urlencoded
(such as for POST, PUT, PATCH).
:meth:`.request` is for making any kind of request, it will look up the
appropriate encoding format and use one of the above two methods to make
the request.
Initializer parameters:
:param headers:
Headers to include with all requests, unless other headers are given
explicitly.
"""
_encode_url_methods = set(['DELETE', 'GET', 'HEAD', 'OPTIONS'])
_encode_body_methods = set(['PATCH', 'POST', 'PUT', 'TRACE'])
def __init__(self, headers=None):<|fim▁hole|> encode_multipart=True, multipart_boundary=None,
**kw): # Abstract
raise NotImplemented("Classes extending RequestMethods must implement "
"their own ``urlopen`` method.")
def request(self, method, url, fields=None, headers=None, **urlopen_kw):
"""
Make a request using :meth:`urlopen` with the appropriate encoding of
``fields`` based on the ``method`` used.
This is a convenience method that requires the least amount of manual
effort. It can be used in most situations, while still having the option
to drop down to more specific methods when necessary, such as
:meth:`request_encode_url`, :meth:`request_encode_body`,
or even the lowest level :meth:`urlopen`.
"""
method = method.upper()
if method in self._encode_url_methods:
return self.request_encode_url(method, url, fields=fields,
headers=headers,
**urlopen_kw)
else:
return self.request_encode_body(method, url, fields=fields,
headers=headers,
**urlopen_kw)
def request_encode_url(self, method, url, fields=None, **urlopen_kw):
"""
Make a request using :meth:`urlopen` with the ``fields`` encoded in
the url. This is useful for request methods like GET, HEAD, DELETE, etc.
"""
if fields:
url += '?' + urlencode(fields)
return self.urlopen(method, url, **urlopen_kw)
def request_encode_body(self, method, url, fields=None, headers=None,
encode_multipart=True, multipart_boundary=None,
**urlopen_kw):
"""
Make a request using :meth:`urlopen` with the ``fields`` encoded in
the body. This is useful for request methods like POST, PUT, PATCH, etc.
When ``encode_multipart=True`` (default), then
:meth:`urllib3.filepost.encode_multipart_formdata` is used to encode the
payload with the appropriate content type. Otherwise
:meth:`urllib.urlencode` is used with the
'application/x-www-form-urlencoded' content type.
Multipart encoding must be used when posting files, and it's reasonably
safe to use it in other times too. However, it may break request signing,
such as with OAuth.
Supports an optional ``fields`` parameter of key/value strings AND
key/filetuple. A filetuple is a (filename, data, MIME type) tuple where
the MIME type is optional. For example: ::
fields = {
'foo': 'bar',
'fakefile': ('foofile.txt', 'contents of foofile'),
'realfile': ('barfile.txt', open('realfile').read()),
'typedfile': ('bazfile.bin', open('bazfile').read(),
'image/jpeg'),
'nonamefile': 'contents of nonamefile field',
}
When uploading a file, providing a filename (the first parameter of the
tuple) is optional but recommended to best mimick behavior of browsers.
Note that if ``headers`` are supplied, the 'Content-Type' header will be
overwritten because it depends on the dynamic random boundary string
which is used to compose the body of the request. The random boundary
string can be explicitly set with the ``multipart_boundary`` parameter.
"""
if encode_multipart:
body, content_type = encode_multipart_formdata(fields or {},
boundary=multipart_boundary)
else:
body, content_type = (urlencode(fields or {}),
'application/x-www-form-urlencoded')
if headers is None:
headers = self.headers
headers_ = {'Content-Type': content_type}
headers_.update(headers)
return self.urlopen(method, url, body=body, headers=headers_,
**urlopen_kw)<|fim▁end|> | self.headers = headers or {}
def urlopen(self, method, url, body=None, headers=None, |
<|file_name|>schema-form.js<|end_file_name|><|fim▁begin|>// Deps is sort of a problem for us, maybe in the future we will ask the user to depend
// on modules for add-ons
var deps = ['ObjectPath'];
try {
//This throws an expection if module does not exist.
angular.module('ngSanitize');
deps.push('ngSanitize');
} catch (e) {}
try {
//This throws an expection if module does not exist.
angular.module('ui.sortable');
deps.push('ui.sortable');
} catch (e) {}
try {
//This throws an expection if module does not exist.
angular.module('angularSpectrumColorpicker');
deps.push('angularSpectrumColorpicker');
} catch (e) {}
angular.module('schemaForm', deps);
angular.module('schemaForm').provider('sfPath',
['ObjectPathProvider', function(ObjectPathProvider) {
var ObjectPath = {parse: ObjectPathProvider.parse};
// if we're on Angular 1.2.x, we need to continue using dot notation
if (angular.version.major === 1 && angular.version.minor < 3) {
ObjectPath.stringify = function(arr) {
return Array.isArray(arr) ? arr.join('.') : arr.toString();
};
} else {
ObjectPath.stringify = ObjectPathProvider.stringify;
}
// We want this to use whichever stringify method is defined above,
// so we have to copy the code here.
ObjectPath.normalize = function(data, quote) {
return ObjectPath.stringify(Array.isArray(data) ? data : ObjectPath.parse(data), quote);
};
this.parse = ObjectPath.parse;
this.stringify = ObjectPath.stringify;
this.normalize = ObjectPath.normalize;
this.$get = function() {
return ObjectPath;
};
}]);
/**
* @ngdoc service
* @name sfSelect
* @kind function
*
*/
angular.module('schemaForm').factory('sfSelect', ['sfPath', function(sfPath) {
var numRe = /^\d+$/;
/**
* @description
* Utility method to access deep properties without
* throwing errors when things are not defined.
* Can also set a value in a deep structure, creating objects when missing
* ex.
* var foo = Select('address.contact.name',obj)
* Select('address.contact.name',obj,'Leeroy')
*
* @param {string} projection A dot path to the property you want to get/set
* @param {object} obj (optional) The object to project on, defaults to 'this'
* @param {Any} valueToSet (opional) The value to set, if parts of the path of
* the projection is missing empty objects will be created.
* @returns {Any|undefined} returns the value at the end of the projection path
* or undefined if there is none.
*/
return function(projection, obj, valueToSet) {
if (!obj) {
obj = this;
}
//Support [] array syntax
var parts = typeof projection === 'string' ? sfPath.parse(projection) : projection;
if (typeof valueToSet !== 'undefined' && parts.length === 1) {
//special case, just setting one variable
obj[parts[0]] = valueToSet;
return obj;
}
if (typeof valueToSet !== 'undefined' &&
typeof obj[parts[0]] === 'undefined') {
// We need to look ahead to check if array is appropriate
obj[parts[0]] = parts.length > 2 && numRe.test(parts[1]) ? [] : {};
}
var value = obj[parts[0]];
for (var i = 1; i < parts.length; i++) {
// Special case: We allow JSON Form syntax for arrays using empty brackets
// These will of course not work here so we exit if they are found.
if (parts[i] === '') {
return undefined;
}
if (typeof valueToSet !== 'undefined') {
if (i === parts.length - 1) {
//last step. Let's set the value
value[parts[i]] = valueToSet;
return valueToSet;
} else {
// Make sure to create new objects on the way if they are not there.
// We need to look ahead to check if array is appropriate
var tmp = value[parts[i]];
if (typeof tmp === 'undefined' || tmp === null) {
tmp = numRe.test(parts[i + 1]) ? [] : {};
value[parts[i]] = tmp;
}
value = tmp;
}
} else if (value) {
//Just get nex value.
value = value[parts[i]];
}
}
return value;
};
}]);
angular.module('schemaForm').provider('schemaFormDecorators',
['$compileProvider', 'sfPathProvider', function($compileProvider, sfPathProvider) {
var defaultDecorator = '';
var directives = {};
var templateUrl = function(name, form) {
//schemaDecorator is alias for whatever is set as default
if (name === 'sfDecorator') {
name = defaultDecorator;
}
var directive = directives[name];
//rules first
var rules = directive.rules;
for (var i = 0; i < rules.length; i++) {
var res = rules[i](form);
if (res) {
return res;
}
}
//then check mapping
if (directive.mappings[form.type]) {
return directive.mappings[form.type];
}
//try default
return directive.mappings['default'];
};
var createDirective = function(name) {
$compileProvider.directive(name, ['$parse', '$compile', '$http', '$templateCache',
function($parse, $compile, $http, $templateCache) {
return {
restrict: 'AE',
replace: false,
transclude: false,
scope: true,
require: '?^sfSchema',
link: function(scope, element, attrs, sfSchema) {
//rebind our part of the form to the scope.
var once = scope.$watch(attrs.form, function(form) {
if (form) {
scope.form = form;
//ok let's replace that template!
//We do this manually since we need to bind ng-model properly and also
//for fieldsets to recurse properly.
var url = templateUrl(name, form);
$http.get(url, {cache: $templateCache}).then(function(res) {
var key = form.key ?
sfPathProvider.stringify(form.key).replace(/"/g, '"') : '';
var template = res.data.replace(
/\$\$value\$\$/g,
'model' + (key[0] !== '[' ? '.' : '') + key
);
element.html(template);
$compile(element.contents())(scope);
});
once();
}
});
//Keep error prone logic from the template
scope.showTitle = function() {
return scope.form && scope.form.notitle !== true && scope.form.title;
};
scope.listToCheckboxValues = function(list) {
var values = {};
angular.forEach(list, function(v) {
values[v] = true;
});
return values;
};
scope.checkboxValuesToList = function(values) {
var lst = [];
angular.forEach(values, function(v, k) {
if (v) {
lst.push(k);
}
});
return lst;
};
scope.buttonClick = function($event, form) {
if (angular.isFunction(form.onClick)) {
form.onClick($event, form);
} else if (angular.isString(form.onClick)) {
if (sfSchema) {
//evaluating in scope outside of sfSchemas isolated scope
sfSchema.evalInParentScope(form.onClick, {'$event': $event, form: form});
} else {
scope.$eval(form.onClick, {'$event': $event, form: form});
}
}
};
/**
* Evaluate an expression, i.e. scope.$eval
* but do it in sfSchemas parent scope sf-schema directive is used
* @param {string} expression
* @param {Object} locals (optional)
* @return {Any} the result of the expression
*/
scope.evalExpr = function(expression, locals) {
if (sfSchema) {
//evaluating in scope outside of sfSchemas isolated scope
return sfSchema.evalInParentScope(expression, locals);
}
return scope.$eval(expression, locals);
};
/**
* Evaluate an expression, i.e. scope.$eval
* in this decorators scope
* @param {string} expression
* @param {Object} locals (optional)
* @return {Any} the result of the expression
*/
scope.evalInScope = function(expression, locals) {
if (expression) {
return scope.$eval(expression, locals);
}
};
/**
* Error message handler
* An error can either be a schema validation message or a angular js validtion
* error (i.e. required)
*/
scope.errorMessage = function(schemaError) {
//User has supplied validation messages
if (scope.form.validationMessage) {
if (schemaError) {
if (angular.isString(scope.form.validationMessage)) {
return scope.form.validationMessage;
}
return scope.form.validationMessage[schemaError.code] ||
scope.form.validationMessage['default'];
} else {
return scope.form.validationMessage.number ||
scope.form.validationMessage['default'] ||
scope.form.validationMessage;
}
}
//No user supplied validation message.
if (schemaError) {
return schemaError.message; //use tv4.js validation message
}
//Otherwise we only have input number not being a number
return 'Not a number';
};
}
};
}
]);
};
var createManualDirective = function(type, templateUrl, transclude) {
transclude = angular.isDefined(transclude) ? transclude : false;
$compileProvider.directive('sf' + angular.uppercase(type[0]) + type.substr(1), function() {
return {
restrict: 'EAC',
scope: true,
replace: true,
transclude: transclude,
template: '<sf-decorator form="form"></sf-decorator>',
link: function(scope, element, attrs) {
var watchThis = {
'items': 'c',
'titleMap': 'c',
'schema': 'c'
};
var form = {type: type};
var once = true;
angular.forEach(attrs, function(value, name) {
if (name[0] !== '$' && name.indexOf('ng') !== 0 && name !== 'sfField') {
var updateForm = function(val) {
if (angular.isDefined(val) && val !== form[name]) {
form[name] = val;
//when we have type, and if specified key we apply it on scope.
if (once && form.type && (form.key || angular.isUndefined(attrs.key))) {
scope.form = form;
once = false;
}
}
};
if (name === 'model') {
//"model" is bound to scope under the name "model" since this is what the decorators
//know and love.
scope.$watch(value, function(val) {
if (val && scope.model !== val) {
scope.model = val;
}
});
} else if (watchThis[name] === 'c') {
//watch collection
scope.$watchCollection(value, updateForm);
} else {
//$observe
attrs.$observe(name, updateForm);
}
}
});
}
};
});
};
/**
* Create a decorator directive and its sibling "manual" use directives.
* The directive can be used to create form fields or other form entities.
* It can be used in conjunction with <schema-form> directive in which case the decorator is
* given it's configuration via a the "form" attribute.
*
* ex. Basic usage
* <sf-decorator form="myform"></sf-decorator>
**
* @param {string} name directive name (CamelCased)
* @param {Object} mappings, an object that maps "type" => "templateUrl"
* @param {Array} rules (optional) a list of functions, function(form) {}, that are each tried in
* turn,
* if they return a string then that is used as the templateUrl. Rules come before
* mappings.
*/
this.createDecorator = function(name, mappings, rules) {
directives[name] = {
mappings: mappings || {},
rules: rules || []
};
if (!directives[defaultDecorator]) {
defaultDecorator = name;
}
createDirective(name);
};
/**
* Creates a directive of a decorator
* Usable when you want to use the decorators without using <schema-form> directive.
* Specifically when you need to reuse styling.
*
* ex. createDirective('text','...')
* <sf-text title="foobar" model="person" key="name" schema="schema"></sf-text>
*
* @param {string} type The type of the directive, resulting directive will have sf- prefixed
* @param {string} templateUrl
* @param {boolean} transclude (optional) sets transclude option of directive, defaults to false.
*/
this.createDirective = createManualDirective;
/**
* Same as createDirective, but takes an object where key is 'type' and value is 'templateUrl'
* Useful for batching.
* @param {Object} mappings
*/
this.createDirectives = function(mappings) {
angular.forEach(mappings, function(url, type) {
createManualDirective(type, url);
});
};
/**
* Getter for directive mappings
* Can be used to override a mapping or add a rule
* @param {string} name (optional) defaults to defaultDecorator
* @return {Object} rules and mappings { rules: [],mappings: {}}
*/
this.directive = function(name) {
name = name || defaultDecorator;
return directives[name];
};
/**
* Adds a mapping to an existing decorator.
* @param {String} name Decorator name
* @param {String} type Form type for the mapping
* @param {String} url The template url
*/
this.addMapping = function(name, type, url) {
if (directives[name]) {
directives[name].mappings[type] = url;
}
};
//Service is just a getter for directive mappings and rules
this.$get = function() {
return {
directive: function(name) {
return directives[name];
},
defaultDecorator: defaultDecorator
};
};
//Create a default directive
createDirective('sfDecorator');
}]);
/**
* Schema form service.
* This service is not that useful outside of schema form directive
* but makes the code more testable.
*/
angular.module('schemaForm').provider('schemaForm',
['sfPathProvider', function(sfPathProvider) {
//Creates an default titleMap list from an enum, i.e. a list of strings.
var enumToTitleMap = function(enm) {
var titleMap = []; //canonical titleMap format is a list.
enm.forEach(function(name) {
titleMap.push({name: name, value: name});
});
return titleMap;
};
// Takes a titleMap in either object or list format and returns one in
// in the list format.
var canonicalTitleMap = function(titleMap, originalEnum) {
if (!angular.isArray(titleMap)) {
var canonical = [];
if (originalEnum) {
angular.forEach(originalEnum, function(value, index) {
canonical.push({name: titleMap[value], value: value});
});
} else {
angular.forEach(titleMap, function(name, value) {
canonical.push({name: name, value: value});
});
}
return canonical;
}
return titleMap;
};
var defaultFormDefinition = function(name, schema, options) {
var rules = defaults[schema.type];
if (rules) {
var def;
for (var i = 0; i < rules.length; i++) {
def = rules[i](name, schema, options);
//first handler in list that actually returns something is our handler!
if (def) {
return def;
}
}
}
};
//Creates a form object with all common properties
var stdFormObj = function(name, schema, options) {
options = options || {};
var f = options.global && options.global.formDefaults ?
angular.copy(options.global.formDefaults) : {};
if (options.global && options.global.supressPropertyTitles === true) {
f.title = schema.title;
} else {
f.title = schema.title || name;
}
if (schema.description) { f.description = schema.description; }
if (options.required === true || schema.required === true) { f.required = true; }
if (schema.maxLength) { f.maxlength = schema.maxLength; }
if (schema.minLength) { f.minlength = schema.maxLength; }
if (schema.readOnly || schema.readonly) { f.readonly = true; }
if (schema.minimum) { f.minimum = schema.minimum + (schema.exclusiveMinimum ? 1 : 0); }
if (schema.maximum) { f.maximum = schema.maximum - (schema.exclusiveMaximum ? 1 : 0); }
//Non standard attributes
if (schema.validationMessage) { f.validationMessage = schema.validationMessage; }
if (schema.enumNames) { f.titleMap = canonicalTitleMap(schema.enumNames, schema['enum']); }
f.schema = schema;
// Ng model options doesn't play nice with undefined, might be defined
// globally though
f.ngModelOptions = f.ngModelOptions || {};
return f;
};
var text = function(name, schema, options) {
if (schema.type === 'string' && !schema['enum']) {
var f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'text';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
//default in json form for number and integer is a text field
//input type="number" would be more suitable don't ya think?
var number = function(name, schema, options) {
if (schema.type === 'number') {
var f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'number';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
var integer = function(name, schema, options) {
if (schema.type === 'integer') {
var f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'number';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
var checkbox = function(name, schema, options) {
if (schema.type === 'boolean') {
var f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'checkbox';
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
var select = function(name, schema, options) {
if (schema.type === 'string' && schema['enum']) {
var f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'select';
if (!f.titleMap) {
f.titleMap = enumToTitleMap(schema['enum']);
}
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
var checkboxes = function(name, schema, options) {
if (schema.type === 'array' && schema.items && schema.items['enum']) {
var f = stdFormObj(name, schema, options);
f.key = options.path;
f.type = 'checkboxes';
if (!f.titleMap) {
f.titleMap = enumToTitleMap(schema.items['enum']);
}
options.lookup[sfPathProvider.stringify(options.path)] = f;
return f;
}
};
var fieldset = function(name, schema, options) {
if (schema.type === 'object') {
var f = stdFormObj(name, schema, options);
f.type = 'fieldset';
f.items = [];
options.lookup[sfPathProvider.stringify(options.path)] = f;
//recurse down into properties
angular.forEach(schema.properties, function(v, k) {
var path = options.path.slice();
path.push(k);
if (options.ignore[sfPathProvider.stringify(path)] !== true) {
var required = schema.required && schema.required.indexOf(k) !== -1;
var def = defaultFormDefinition(k, v, {
path: path,
required: required || false,
lookup: options.lookup,
ignore: options.ignore
});
if (def) {
f.items.push(def);
}
}
});
return f;
}
};
var array = function(name, schema, options) {
if (schema.type === 'array') {
var f = stdFormObj(name, schema, options);
f.type = 'array';
f.key = options.path;
options.lookup[sfPathProvider.stringify(options.path)] = f;
var required = schema.required &&
schema.required.indexOf(options.path[options.path.length - 1]) !== -1;
// The default is to always just create one child. This works since if the
// schemas items declaration is of type: "object" then we get a fieldset.
// We also follow json form notatation, adding empty brackets "[]" to
// signify arrays.
var arrPath = options.path.slice();
arrPath.push('');
f.items = [defaultFormDefinition(name, schema.items, {
path: arrPath,
required: required || false,
lookup: options.lookup,
ignore: options.ignore,
global: options.global
})];
return f;
}
};
//First sorted by schema type then a list.
//Order has importance. First handler returning an form snippet will be used.
var defaults = {
string: [select, text],
object: [fieldset],
number: [number],
integer: [integer],
boolean: [checkbox],
array: [checkboxes, array]
};
var postProcessFn = function(form) { return form; };
/**
* Provider API
*/
this.defaults = defaults;
this.stdFormObj = stdFormObj;
this.defaultFormDefinition = defaultFormDefinition;
/**
* Register a post process function.
* This function is called with the fully merged
* form definition (i.e. after merging with schema)
* and whatever it returns is used as form.
*/
this.postProcess = function(fn) {
postProcessFn = fn;
};
/**
* Append default form rule
* @param {string} type json schema type
* @param {Function} rule a function(propertyName,propertySchema,options) that returns a form
* definition or undefined
*/
this.appendRule = function(type, rule) {
if (!defaults[type]) {
defaults[type] = [];
}
defaults[type].push(rule);
};
/**
* Prepend default form rule
* @param {string} type json schema type
* @param {Function} rule a function(propertyName,propertySchema,options) that returns a form
* definition or undefined
*/
this.prependRule = function(type, rule) {
if (!defaults[type]) {
defaults[type] = [];
}
defaults[type].unshift(rule);
};
/**
* Utility function to create a standard form object.
* This does *not* set the type of the form but rather all shared attributes.
* You probably want to start your rule with creating the form with this method
* then setting type and any other values you need.
* @param {Object} schema
* @param {Object} options
* @return {Object} a form field defintion
*/
this.createStandardForm = stdFormObj;
/* End Provider API */
this.$get = function() {
var service = {};
service.merge = function(schema, form, ignore, options, readonly) {
form = form || ['*'];
options = options || {};
// Get readonly from root object
readonly = readonly || schema.readonly || schema.readOnly;
var stdForm = service.defaults(schema, ignore, options);
//simple case, we have a "*", just put the stdForm there
var idx = form.indexOf('*');
if (idx !== -1) {
form = form.slice(0, idx)
.concat(stdForm.form)
.concat(form.slice(idx + 1));
}
//ok let's merge!
//We look at the supplied form and extend it with schema standards
var lookup = stdForm.lookup;
return postProcessFn(form.map(function(obj) {
//handle the shortcut with just a name
if (typeof obj === 'string') {
obj = {key: obj};
}
if (obj.key) {
if (typeof obj.key === 'string') {
obj.key = sfPathProvider.parse(obj.key);
}
}
//If it has a titleMap make sure it's a list
if (obj.titleMap) {
obj.titleMap = canonicalTitleMap(obj.titleMap);
}
//
if (obj.itemForm) {
obj.items = [];
var str = sfPathProvider.stringify(obj.key);
var stdForm = lookup[str];
angular.forEach(stdForm.items, function(item) {
var o = angular.copy(obj.itemForm);
o.key = item.key;
obj.items.push(o);
});
}
//extend with std form from schema.
if (obj.key) {
var strid = sfPathProvider.stringify(obj.key);
if (lookup[strid]) {
obj = angular.extend(lookup[strid], obj);
}
}
// Are we inheriting readonly?
if (readonly === true) { // Inheriting false is not cool.
obj.readonly = true;
}
//if it's a type with items, merge 'em!
if (obj.items) {
obj.items = service.merge(schema, obj.items, ignore, options, obj.readonly);
}
//if its has tabs, merge them also!
if (obj.tabs) {
angular.forEach(obj.tabs, function(tab) {
tab.items = service.merge(schema, tab.items, ignore, options, obj.readonly);
});
}
// Special case: checkbox
// Since have to ternary state we need a default
if (obj.type === 'checkbox' && angular.isUndefined(obj.schema['default'])) {
obj.schema['default'] = false;
}
return obj;
}));
};
/**
* Create form defaults from schema
*/
service.defaults = function(schema, ignore, globalOptions) {
var form = [];
var lookup = {}; //Map path => form obj for fast lookup in merging
ignore = ignore || {};
globalOptions = globalOptions || {};
if (schema.type === 'object') {
angular.forEach(schema.properties, function(v, k) {
if (ignore[k] !== true) {
var required = schema.required && schema.required.indexOf(k) !== -1;
var def = defaultFormDefinition(k, v, {
path: [k], // Path to this property in bracket notation.
lookup: lookup, // Extra map to register with. Optimization for merger.
ignore: ignore, // The ignore list of paths (sans root level name)
required: required, // Is it required? (v4 json schema style)
global: globalOptions // Global options, including form defaults
});
if (def) {
form.push(def);
}
}
});
} else {
throw new Error('Not implemented. Only type "object" allowed at root level of schema.');
}
return {form: form, lookup: lookup};
};
//Utility functions
/**
* Traverse a schema, applying a function(schema,path) on every sub schema
* i.e. every property of an object.
*/
service.traverseSchema = function(schema, fn, path, ignoreArrays) {
ignoreArrays = angular.isDefined(ignoreArrays) ? ignoreArrays : true;
path = path || [];
var traverse = function(schema, fn, path) {
fn(schema, path);
angular.forEach(schema.properties, function(prop, name) {
var currentPath = path.slice();
currentPath.push(name);
traverse(prop, fn, currentPath);
});
//Only support type "array" which have a schema as "items".
if (!ignoreArrays && schema.items) {
var arrPath = path.slice(); arrPath.push('');
traverse(schema.items, fn, arrPath);
}
};
traverse(schema, fn, path || []);<|fim▁hole|> };
service.traverseForm = function(form, fn) {
fn(form);
angular.forEach(form.items, function(f) {
service.traverseForm(f, fn);
});
if (form.tabs) {
angular.forEach(form.tabs, function(tab) {
angular.forEach(tab.items, function(f) {
service.traverseForm(f, fn);
});
});
}
};
return service;
};
}]);
/* Common code for validating a value against its form and schema definition */
/* global tv4 */
angular.module('schemaForm').factory('sfValidator', [function() {
var validator = {};
/**
* Validate a value against its form definition and schema.
* The value should either be of proper type or a string, some type
* coercion is applied.
*
* @param {Object} form A merged form definition, i.e. one with a schema.
* @param {Any} value the value to validate.
* @return a tv4js result object.
*/
validator.validate = function(form, value) {
if (!form) {
return {valid: true};
}
var schema = form.schema;
if (!schema) {
return {valid: true};
}
// Input of type text and textareas will give us a viewValue of ''
// when empty, this is a valid value in a schema and does not count as something
// that breaks validation of 'required'. But for our own sanity an empty field should
// not validate if it's required.
if (value === '') {
value = undefined;
}
// Numbers fields will give a null value, which also means empty field
if (form.type === 'number' && value === null) {
value = undefined;
}
// Version 4 of JSON Schema has the required property not on the
// property itself but on the wrapping object. Since we like to test
// only this property we wrap it in a fake object.
var wrap = {type: 'object', 'properties': {}};
var propName = form.key[form.key.length - 1];
wrap.properties[propName] = schema;
if (form.required) {
wrap.required = [propName];
}
var valueWrap = {};
if (angular.isDefined(value)) {
valueWrap[propName] = value;
}
return tv4.validateResult(valueWrap, wrap);
};
return validator;
}]);
/**
* Directive that handles the model arrays
*/
angular.module('schemaForm').directive('sfArray', ['sfSelect', 'schemaForm', 'sfValidator',
function(sfSelect, schemaForm, sfValidator) {
var setIndex = function(index) {
return function(form) {
if (form.key) {
form.key[form.key.indexOf('')] = index;
}
};
};
return {
restrict: 'A',
scope: true,
require: '?ngModel',
link: function(scope, element, attrs, ngModel) {
var formDefCache = {};
// Watch for the form definition and then rewrite it.
// It's the (first) array part of the key, '[]' that needs a number
// corresponding to an index of the form.
var once = scope.$watch(attrs.sfArray, function(form) {
// An array model always needs a key so we know what part of the model
// to look at. This makes us a bit incompatible with JSON Form, on the
// other hand it enables two way binding.
var list = sfSelect(form.key, scope.model);
// Since ng-model happily creates objects in a deep path when setting a
// a value but not arrays we need to create the array.
if (angular.isUndefined(list)) {
list = [];
sfSelect(form.key, scope.model, list);
}
scope.modelArray = list;
// Arrays with titleMaps, i.e. checkboxes doesn't have items.
if (form.items) {
// To be more compatible with JSON Form we support an array of items
// in the form definition of "array" (the schema just a value).
// for the subforms code to work this means we wrap everything in a
// section. Unless there is just one.
var subForm = form.items[0];
if (form.items.length > 1) {
subForm = {
type: 'section',
items: form.items.map(function(item){
item.ngModelOptions = form.ngModelOptions;
item.readonly = form.readonly;
return item;
})
};
}
}
// We ceate copies of the form on demand, caching them for
// later requests
scope.copyWithIndex = function(index) {
if (!formDefCache[index]) {
if (subForm) {
var copy = angular.copy(subForm);
copy.arrayIndex = index;
schemaForm.traverseForm(copy, setIndex(index));
formDefCache[index] = copy;
}
}
return formDefCache[index];
};
scope.appendToArray = function() {
var len = list.length;
var copy = scope.copyWithIndex(len);
schemaForm.traverseForm(copy, function(part) {
if (part.key && angular.isDefined(part['default'])) {
sfSelect(part.key, scope.model, part['default']);
}
});
// If there are no defaults nothing is added so we need to initialize
// the array. undefined for basic values, {} or [] for the others.
if (len === list.length) {
var type = sfSelect('schema.items.type', form);
var dflt;
if (type === 'object') {
dflt = {};
} else if (type === 'array') {
dflt = [];
}
list.push(dflt);
}
// Trigger validation.
if (scope.validateArray) {
scope.validateArray();
}
return list;
};
scope.deleteFromArray = function(index) {
list.splice(index, 1);
// Trigger validation.
if (scope.validateArray) {
scope.validateArray();
}
return list;
};
// Always start with one empty form unless configured otherwise.
// Special case: don't do it if form has a titleMap
if (!form.titleMap && form.startEmpty !== true && list.length === 0) {
scope.appendToArray();
}
// Title Map handling
// If form has a titleMap configured we'd like to enable looping over
// titleMap instead of modelArray, this is used for intance in
// checkboxes. So instead of variable number of things we like to create
// a array value from a subset of values in the titleMap.
// The problem here is that ng-model on a checkbox doesn't really map to
// a list of values. This is here to fix that.
if (form.titleMap && form.titleMap.length > 0) {
scope.titleMapValues = [];
// We watch the model for changes and the titleMapValues to reflect
// the modelArray
var updateTitleMapValues = function(arr) {
scope.titleMapValues = [];
arr = arr || [];
form.titleMap.forEach(function(item) {
scope.titleMapValues.push(arr.indexOf(item.value) !== -1);
});
};
//Catch default values
updateTitleMapValues(scope.modelArray);
scope.$watchCollection('modelArray', updateTitleMapValues);
//To get two way binding we also watch our titleMapValues
scope.$watchCollection('titleMapValues', function(vals) {
if (vals) {
var arr = scope.modelArray;
// Apparently the fastest way to clear an array, readable too.
// http://jsperf.com/array-destroy/32
while (arr.length > 0) {
arr.shift();
}
form.titleMap.forEach(function(item, index) {
if (vals[index]) {
arr.push(item.value);
}
});
}
});
}
// If there is a ngModel present we need to validate when asked.
if (ngModel) {
var error;
scope.validateArray = function() {
// The actual content of the array is validated by each field
// so we settle for checking validations specific to arrays
// Since we prefill with empty arrays we can get the funny situation
// where the array is required but empty in the gui but still validates.
// Thats why we check the length.
var result = sfValidator.validate(
form,
scope.modelArray.length > 0 ? scope.modelArray : undefined
);
if (result.valid === false &&
result.error &&
(result.error.dataPath === '' ||
result.error.dataPath === '/' + form.key[form.key.length - 1])) {
// Set viewValue to trigger $dirty on field. If someone knows a
// a better way to do it please tell.
ngModel.$setViewValue(scope.modelArray);
error = result.error;
ngModel.$setValidity('schema', false);
} else {
ngModel.$setValidity('schema', true);
}
};
scope.$on('schemaFormValidate', scope.validateArray);
scope.hasSuccess = function() {
return ngModel.$valid && !ngModel.$pristine;
};
scope.hasError = function() {
return ngModel.$invalid;
};
scope.schemaError = function() {
return error;
};
}
once();
});
}
};
}
]);
/**
* A version of ng-changed that only listens if
* there is actually a onChange defined on the form
*
* Takes the form definition as argument.
* If the form definition has a "onChange" defined as either a function or
*/
angular.module('schemaForm').directive('sfChanged', function() {
return {
require: 'ngModel',
restrict: 'AC',
scope: false,
link: function(scope, element, attrs, ctrl) {
var form = scope.$eval(attrs.sfChanged);
//"form" is really guaranteed to be here since the decorator directive
//waits for it. But best be sure.
if (form && form.onChange) {
ctrl.$viewChangeListeners.push(function() {
if (angular.isFunction(form.onChange)) {
form.onChange(ctrl.$modelValue, form);
} else {
scope.evalExpr(form.onChange, {'modelValue': ctrl.$modelValue, form: form});
}
});
}
}
};
});
/*
FIXME: real documentation
<form sf-form="form" sf-schema="schema" sf-decorator="foobar"></form>
*/
angular.module('schemaForm')
.directive('sfSchema',
['$compile', 'schemaForm', 'schemaFormDecorators', 'sfSelect',
function($compile, schemaForm, schemaFormDecorators, sfSelect) {
var SNAKE_CASE_REGEXP = /[A-Z]/g;
var snakeCase = function(name, separator) {
separator = separator || '_';
return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
return (pos ? separator : '') + letter.toLowerCase();
});
};
return {
scope: {
schema: '=sfSchema',
initialForm: '=sfForm',
model: '=sfModel',
options: '=sfOptions'
},
controller: ['$scope', function($scope) {
this.evalInParentScope = function(expr, locals) {
return $scope.$parent.$eval(expr, locals);
};
}],
replace: false,
restrict: 'A',
transclude: true,
require: '?form',
link: function(scope, element, attrs, formCtrl, transclude) {
//expose form controller on scope so that we don't force authors to use name on form
scope.formCtrl = formCtrl;
//We'd like to handle existing markup,
//besides using it in our template we also
//check for ng-model and add that to an ignore list
//i.e. even if form has a definition for it or form is ["*"]
//we don't generate it.
var ignore = {};
transclude(scope, function(clone) {
clone.addClass('schema-form-ignore');
element.prepend(clone);
if (element[0].querySelectorAll) {
var models = element[0].querySelectorAll('[ng-model]');
if (models) {
for (var i = 0; i < models.length; i++) {
var key = models[i].getAttribute('ng-model');
//skip first part before .
ignore[key.substring(key.indexOf('.') + 1)] = true;
}
}
}
});
//Since we are dependant on up to three
//attributes we'll do a common watch
var lastDigest = {};
scope.$watch(function() {
var schema = scope.schema;
var form = scope.initialForm || ['*'];
//The check for schema.type is to ensure that schema is not {}
if (form && schema && schema.type &&
(lastDigest.form !== form || lastDigest.schema !== schema) &&
Object.keys(schema.properties).length > 0) {
lastDigest.schema = schema;
lastDigest.form = form;
var merged = schemaForm.merge(schema, form, ignore, scope.options);
var frag = document.createDocumentFragment();
//make the form available to decorators
scope.schemaForm = {form: merged, schema: schema};
//clean all but pre existing html.
element.children(':not(.schema-form-ignore)').remove();
//Create directives from the form definition
angular.forEach(merged,function(obj,i){
var n = document.createElement(attrs.sfDecorator || snakeCase(schemaFormDecorators.defaultDecorator,'-'));
n.setAttribute('form','schemaForm.form['+i+']');
var slot;
try {
slot = element[0].querySelector('*[sf-insert-field="' + obj.key + '"]');
} catch(err) {
// field insertion not supported for complex keys
slot = null;
}
if(slot) {
slot.innerHTML = "";
slot.appendChild(n);
} else {
frag.appendChild(n);
}
});
element[0].appendChild(frag);
//compile only children
$compile(element.children())(scope);
//ok, now that that is done let's set any defaults
schemaForm.traverseSchema(schema, function(prop, path) {
if (angular.isDefined(prop['default'])) {
var val = sfSelect(path, scope.model);
if (angular.isUndefined(val)) {
sfSelect(path, scope.model, prop['default']);
}
}
});
}
});
}
};
}
]);
angular.module('schemaForm').directive('schemaValidate', ['sfValidator', function(sfValidator) {
return {
restrict: 'A',
scope: false,
// We want the link function to be *after* the input directives link function so we get access
// the parsed value, ex. a number instead of a string
priority: 1000,
require: 'ngModel',
link: function(scope, element, attrs, ngModel) {
//Since we have scope false this is the same scope
//as the decorator
scope.ngModel = ngModel;
var error = null;
var getForm = function() {
if (!form) {
form = scope.$eval(attrs.schemaValidate);
}
return form;
};
var form = getForm();
// Validate against the schema.
// Get in last of the parses so the parsed value has the correct type.
if (ngModel.$validators) { // Angular 1.3
ngModel.$validators.schema = function(value) {
var result = sfValidator.validate(getForm(), value);
error = result.error;
return result.valid;
};
} else {
// Angular 1.2
ngModel.$parsers.push(function(viewValue) {
form = getForm();
//Still might be undefined
if (!form) {
return viewValue;
}
var result = sfValidator.validate(form, viewValue);
if (result.valid) {
// it is valid
ngModel.$setValidity('schema', true);
return viewValue;
} else {
// it is invalid, return undefined (no model update)
ngModel.$setValidity('schema', false);
error = result.error;
return undefined;
}
});
}
// Listen to an event so we can validate the input on request
scope.$on('schemaFormValidate', function() {
if (ngModel.$validate) {
ngModel.$validate();
if (ngModel.$invalid) { // The field must be made dirty so the error message is displayed
ngModel.$dirty = true;
ngModel.$pristine = false;
}
} else {
ngModel.$setViewValue(ngModel.$viewValue);
}
});
//This works since we now we're inside a decorator and that this is the decorators scope.
//If $pristine and empty don't show success (even if it's valid)
scope.hasSuccess = function() {
return ngModel.$valid && (!ngModel.$pristine || !ngModel.$isEmpty(ngModel.$modelValue));
};
scope.hasError = function() {
return ngModel.$invalid && !ngModel.$pristine;
};
scope.schemaError = function() {
return error;
};
}
};
}]);<|fim▁end|> | |
<|file_name|>manage.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
import os.path
import sys
DIRNAME = os.path.dirname(__file__)
if not DIRNAME in sys.path:
sys.path.append(DIRNAME)
<|fim▁hole|> import sys
sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__)
sys.exit(1)
if __name__ == "__main__":
execute_manager(settings)<|fim▁end|> | from django.core.management import execute_manager
try:
import settings # Assumed to be in the same directory.
except ImportError: |
<|file_name|>mem.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this<|fim▁hole|>//! Memory profiling functions.
use crate::time::duration_from_seconds;
use ipc_channel::ipc::{self, IpcReceiver};
use ipc_channel::router::ROUTER;
use profile_traits::mem::ReportsChan;
use profile_traits::mem::{ProfilerChan, ProfilerMsg, ReportKind, Reporter, ReporterRequest};
use std::borrow::ToOwned;
use std::cmp::Ordering;
use std::collections::HashMap;
use std::thread;
use std::time::Instant;
pub struct Profiler {
/// The port through which messages are received.
pub port: IpcReceiver<ProfilerMsg>,
/// Registered memory reporters.
reporters: HashMap<String, Reporter>,
/// Instant at which this profiler was created.
created: Instant,
}
const JEMALLOC_HEAP_ALLOCATED_STR: &'static str = "jemalloc-heap-allocated";
const SYSTEM_HEAP_ALLOCATED_STR: &'static str = "system-heap-allocated";
impl Profiler {
pub fn create(period: Option<f64>) -> ProfilerChan {
let (chan, port) = ipc::channel().unwrap();
// Create the timer thread if a period was provided.
if let Some(period) = period {
let chan = chan.clone();
thread::Builder::new()
.name("Memory profiler timer".to_owned())
.spawn(move || loop {
thread::sleep(duration_from_seconds(period));
if chan.send(ProfilerMsg::Print).is_err() {
break;
}
})
.expect("Thread spawning failed");
}
// Always spawn the memory profiler. If there is no timer thread it won't receive regular
// `Print` events, but it will still receive the other events.
thread::Builder::new()
.name("Memory profiler".to_owned())
.spawn(move || {
let mut mem_profiler = Profiler::new(port);
mem_profiler.start();
})
.expect("Thread spawning failed");
let mem_profiler_chan = ProfilerChan(chan);
// Register the system memory reporter, which will run on its own thread. It never needs to
// be unregistered, because as long as the memory profiler is running the system memory
// reporter can make measurements.
let (system_reporter_sender, system_reporter_receiver) = ipc::channel().unwrap();
ROUTER.add_route(
system_reporter_receiver.to_opaque(),
Box::new(|message| {
let request: ReporterRequest = message.to().unwrap();
system_reporter::collect_reports(request)
}),
);
mem_profiler_chan.send(ProfilerMsg::RegisterReporter(
"system".to_owned(),
Reporter(system_reporter_sender),
));
mem_profiler_chan
}
pub fn new(port: IpcReceiver<ProfilerMsg>) -> Profiler {
Profiler {
port: port,
reporters: HashMap::new(),
created: Instant::now(),
}
}
pub fn start(&mut self) {
while let Ok(msg) = self.port.recv() {
if !self.handle_msg(msg) {
break;
}
}
}
fn handle_msg(&mut self, msg: ProfilerMsg) -> bool {
match msg {
ProfilerMsg::RegisterReporter(name, reporter) => {
// Panic if it has already been registered.
let name_clone = name.clone();
match self.reporters.insert(name, reporter) {
None => true,
Some(_) => panic!(format!(
"RegisterReporter: '{}' name is already in use",
name_clone
)),
}
},
ProfilerMsg::UnregisterReporter(name) => {
// Panic if it hasn't previously been registered.
match self.reporters.remove(&name) {
Some(_) => true,
None => panic!(format!("UnregisterReporter: '{}' name is unknown", &name)),
}
},
ProfilerMsg::Print => {
self.handle_print_msg();
true
},
ProfilerMsg::Exit => false,
}
}
fn handle_print_msg(&self) {
let elapsed = self.created.elapsed();
println!("Begin memory reports {}", elapsed.as_secs());
println!("|");
// Collect reports from memory reporters.
//
// This serializes the report-gathering. It might be worth creating a new scoped thread for
// each reporter once we have enough of them.
//
// If anything goes wrong with a reporter, we just skip it.
//
// We also track the total memory reported on the jemalloc heap and the system heap, and
// use that to compute the special "jemalloc-heap-unclassified" and
// "system-heap-unclassified" values.
let mut forest = ReportsForest::new();
let mut jemalloc_heap_reported_size = 0;
let mut system_heap_reported_size = 0;
let mut jemalloc_heap_allocated_size: Option<usize> = None;
let mut system_heap_allocated_size: Option<usize> = None;
for reporter in self.reporters.values() {
let (chan, port) = ipc::channel().unwrap();
reporter.collect_reports(ReportsChan(chan));
if let Ok(mut reports) = port.recv() {
for report in &mut reports {
// Add "explicit" to the start of the path, when appropriate.
match report.kind {
ReportKind::ExplicitJemallocHeapSize |
ReportKind::ExplicitSystemHeapSize |
ReportKind::ExplicitNonHeapSize |
ReportKind::ExplicitUnknownLocationSize => {
report.path.insert(0, String::from("explicit"))
},
ReportKind::NonExplicitSize => {},
}
// Update the reported fractions of the heaps, when appropriate.
match report.kind {
ReportKind::ExplicitJemallocHeapSize => {
jemalloc_heap_reported_size += report.size
},
ReportKind::ExplicitSystemHeapSize => {
system_heap_reported_size += report.size
},
_ => {},
}
// Record total size of the heaps, when we see them.
if report.path.len() == 1 {
if report.path[0] == JEMALLOC_HEAP_ALLOCATED_STR {
assert!(jemalloc_heap_allocated_size.is_none());
jemalloc_heap_allocated_size = Some(report.size);
} else if report.path[0] == SYSTEM_HEAP_ALLOCATED_STR {
assert!(system_heap_allocated_size.is_none());
system_heap_allocated_size = Some(report.size);
}
}
// Insert the report.
forest.insert(&report.path, report.size);
}
}
}
// Compute and insert the heap-unclassified values.
if let Some(jemalloc_heap_allocated_size) = jemalloc_heap_allocated_size {
forest.insert(
&path!["explicit", "jemalloc-heap-unclassified"],
jemalloc_heap_allocated_size - jemalloc_heap_reported_size,
);
}
if let Some(system_heap_allocated_size) = system_heap_allocated_size {
forest.insert(
&path!["explicit", "system-heap-unclassified"],
system_heap_allocated_size - system_heap_reported_size,
);
}
forest.print();
println!("|");
println!("End memory reports");
println!("");
}
}
/// A collection of one or more reports with the same initial path segment. A ReportsTree
/// containing a single node is described as "degenerate".
struct ReportsTree {
/// For leaf nodes, this is the sum of the sizes of all reports that mapped to this location.
/// For interior nodes, this is the sum of the sizes of all its child nodes.
size: usize,
/// For leaf nodes, this is the count of all reports that mapped to this location.
/// For interor nodes, this is always zero.
count: u32,
/// The segment from the report path that maps to this node.
path_seg: String,
/// Child nodes.
children: Vec<ReportsTree>,
}
impl ReportsTree {
fn new(path_seg: String) -> ReportsTree {
ReportsTree {
size: 0,
count: 0,
path_seg: path_seg,
children: vec![],
}
}
// Searches the tree's children for a path_seg match, and returns the index if there is a
// match.
fn find_child(&self, path_seg: &str) -> Option<usize> {
for (i, child) in self.children.iter().enumerate() {
if child.path_seg == *path_seg {
return Some(i);
}
}
None
}
// Insert the path and size into the tree, adding any nodes as necessary.
fn insert(&mut self, path: &[String], size: usize) {
let mut t: &mut ReportsTree = self;
for path_seg in path {
let i = match t.find_child(&path_seg) {
Some(i) => i,
None => {
let new_t = ReportsTree::new(path_seg.clone());
t.children.push(new_t);
t.children.len() - 1
},
};
let tmp = t; // this temporary is needed to satisfy the borrow checker
t = &mut tmp.children[i];
}
t.size += size;
t.count += 1;
}
// Fill in sizes for interior nodes and sort sub-trees accordingly. Should only be done once
// all the reports have been inserted.
fn compute_interior_node_sizes_and_sort(&mut self) -> usize {
if !self.children.is_empty() {
// Interior node. Derive its size from its children.
if self.size != 0 {
// This will occur if e.g. we have paths ["a", "b"] and ["a", "b", "c"].
panic!("one report's path is a sub-path of another report's path");
}
for child in &mut self.children {
self.size += child.compute_interior_node_sizes_and_sort();
}
// Now that child sizes have been computed, we can sort the children.
self.children.sort_by(|t1, t2| t2.size.cmp(&t1.size));
}
self.size
}
fn print(&self, depth: i32) {
if !self.children.is_empty() {
assert_eq!(self.count, 0);
}
let mut indent_str = String::new();
for _ in 0..depth {
indent_str.push_str(" ");
}
let mebi = 1024f64 * 1024f64;
let count_str = if self.count > 1 {
format!(" [{}]", self.count)
} else {
"".to_owned()
};
println!(
"|{}{:8.2} MiB -- {}{}",
indent_str,
(self.size as f64) / mebi,
self.path_seg,
count_str
);
for child in &self.children {
child.print(depth + 1);
}
}
}
/// A collection of ReportsTrees. It represents the data from multiple memory reports in a form
/// that's good to print.
struct ReportsForest {
trees: HashMap<String, ReportsTree>,
}
impl ReportsForest {
fn new() -> ReportsForest {
ReportsForest {
trees: HashMap::new(),
}
}
// Insert the path and size into the forest, adding any trees and nodes as necessary.
fn insert(&mut self, path: &[String], size: usize) {
let (head, tail) = path.split_first().unwrap();
// Get the right tree, creating it if necessary.
if !self.trees.contains_key(head) {
self.trees
.insert(head.clone(), ReportsTree::new(head.clone()));
}
let t = self.trees.get_mut(head).unwrap();
// Use tail because the 0th path segment was used to find the right tree in the forest.
t.insert(tail, size);
}
fn print(&mut self) {
// Fill in sizes of interior nodes, and recursively sort the sub-trees.
for (_, tree) in &mut self.trees {
tree.compute_interior_node_sizes_and_sort();
}
// Put the trees into a sorted vector. Primary sort: degenerate trees (those containing a
// single node) come after non-degenerate trees. Secondary sort: alphabetical order of the
// root node's path_seg.
let mut v = vec![];
for (_, tree) in &self.trees {
v.push(tree);
}
v.sort_by(|a, b| {
if a.children.is_empty() && !b.children.is_empty() {
Ordering::Greater
} else if !a.children.is_empty() && b.children.is_empty() {
Ordering::Less
} else {
a.path_seg.cmp(&b.path_seg)
}
});
// Print the forest.
for tree in &v {
tree.print(0);
// Print a blank line after non-degenerate trees.
if !tree.children.is_empty() {
println!("|");
}
}
}
}
//---------------------------------------------------------------------------
mod system_reporter {
use super::{JEMALLOC_HEAP_ALLOCATED_STR, SYSTEM_HEAP_ALLOCATED_STR};
#[cfg(target_os = "linux")]
use libc::c_int;
#[cfg(all(feature = "unstable", not(target_os = "windows")))]
use libc::{c_void, size_t};
use profile_traits::mem::{Report, ReportKind, ReporterRequest};
#[cfg(all(feature = "unstable", not(target_os = "windows")))]
use std::ffi::CString;
#[cfg(all(feature = "unstable", not(target_os = "windows")))]
use std::mem::size_of;
#[cfg(all(feature = "unstable", not(target_os = "windows")))]
use std::ptr::null_mut;
#[cfg(target_os = "macos")]
use task_info::task_basic_info::{resident_size, virtual_size};
/// Collects global measurements from the OS and heap allocators.
pub fn collect_reports(request: ReporterRequest) {
let mut reports = vec![];
{
let mut report = |path, size| {
if let Some(size) = size {
reports.push(Report {
path: path,
kind: ReportKind::NonExplicitSize,
size: size,
});
}
};
// Virtual and physical memory usage, as reported by the OS.
report(path!["vsize"], vsize());
report(path!["resident"], resident());
// Memory segments, as reported by the OS.
for seg in resident_segments() {
report(path!["resident-according-to-smaps", seg.0], Some(seg.1));
}
// Total number of bytes allocated by the application on the system
// heap.
report(path![SYSTEM_HEAP_ALLOCATED_STR], system_heap_allocated());
// The descriptions of the following jemalloc measurements are taken
// directly from the jemalloc documentation.
// "Total number of bytes allocated by the application."
report(
path![JEMALLOC_HEAP_ALLOCATED_STR],
jemalloc_stat("stats.allocated"),
);
// "Total number of bytes in active pages allocated by the application.
// This is a multiple of the page size, and greater than or equal to
// |stats.allocated|."
report(path!["jemalloc-heap-active"], jemalloc_stat("stats.active"));
// "Total number of bytes in chunks mapped on behalf of the application.
// This is a multiple of the chunk size, and is at least as large as
// |stats.active|. This does not include inactive chunks."
report(path!["jemalloc-heap-mapped"], jemalloc_stat("stats.mapped"));
}
request.reports_channel.send(reports);
}
#[cfg(target_os = "linux")]
extern "C" {
fn mallinfo() -> struct_mallinfo;
}
#[cfg(target_os = "linux")]
#[repr(C)]
pub struct struct_mallinfo {
arena: c_int,
ordblks: c_int,
smblks: c_int,
hblks: c_int,
hblkhd: c_int,
usmblks: c_int,
fsmblks: c_int,
uordblks: c_int,
fordblks: c_int,
keepcost: c_int,
}
#[cfg(target_os = "linux")]
fn system_heap_allocated() -> Option<usize> {
let info: struct_mallinfo = unsafe { mallinfo() };
// The documentation in the glibc man page makes it sound like |uordblks| would suffice,
// but that only gets the small allocations that are put in the brk heap. We need |hblkhd|
// as well to get the larger allocations that are mmapped.
//
// These fields are unfortunately |int| and so can overflow (becoming negative) if memory
// usage gets high enough. So don't report anything in that case. In the non-overflow case
// we cast the two values to usize before adding them to make sure the sum also doesn't
// overflow.
if info.hblkhd < 0 || info.uordblks < 0 {
None
} else {
Some(info.hblkhd as usize + info.uordblks as usize)
}
}
#[cfg(not(target_os = "linux"))]
fn system_heap_allocated() -> Option<usize> {
None
}
#[cfg(all(feature = "unstable", not(target_os = "windows")))]
use servo_allocator::jemalloc_sys::mallctl;
#[cfg(all(feature = "unstable", not(target_os = "windows")))]
fn jemalloc_stat(value_name: &str) -> Option<usize> {
// Before we request the measurement of interest, we first send an "epoch"
// request. Without that jemalloc gives cached statistics(!) which can be
// highly inaccurate.
let epoch_name = "epoch";
let epoch_c_name = CString::new(epoch_name).unwrap();
let mut epoch: u64 = 0;
let epoch_ptr = &mut epoch as *mut _ as *mut c_void;
let mut epoch_len = size_of::<u64>() as size_t;
let value_c_name = CString::new(value_name).unwrap();
let mut value: size_t = 0;
let value_ptr = &mut value as *mut _ as *mut c_void;
let mut value_len = size_of::<size_t>() as size_t;
// Using the same values for the `old` and `new` parameters is enough
// to get the statistics updated.
let rv = unsafe {
mallctl(
epoch_c_name.as_ptr(),
epoch_ptr,
&mut epoch_len,
epoch_ptr,
epoch_len,
)
};
if rv != 0 {
return None;
}
let rv = unsafe {
mallctl(
value_c_name.as_ptr(),
value_ptr,
&mut value_len,
null_mut(),
0,
)
};
if rv != 0 {
return None;
}
Some(value as usize)
}
#[cfg(any(target_os = "windows", not(feature = "unstable")))]
fn jemalloc_stat(_value_name: &str) -> Option<usize> {
None
}
#[cfg(target_os = "linux")]
fn page_size() -> usize {
unsafe { ::libc::sysconf(::libc::_SC_PAGESIZE) as usize }
}
#[cfg(target_os = "linux")]
fn proc_self_statm_field(field: usize) -> Option<usize> {
use std::fs::File;
use std::io::Read;
let mut f = File::open("/proc/self/statm").ok()?;
let mut contents = String::new();
f.read_to_string(&mut contents).ok()?;
let s = contents.split_whitespace().nth(field)?;
let npages = s.parse::<usize>().ok()?;
Some(npages * page_size())
}
#[cfg(target_os = "linux")]
fn vsize() -> Option<usize> {
proc_self_statm_field(0)
}
#[cfg(target_os = "linux")]
fn resident() -> Option<usize> {
proc_self_statm_field(1)
}
#[cfg(target_os = "macos")]
fn vsize() -> Option<usize> {
virtual_size()
}
#[cfg(target_os = "macos")]
fn resident() -> Option<usize> {
resident_size()
}
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
fn vsize() -> Option<usize> {
None
}
#[cfg(not(any(target_os = "linux", target_os = "macos")))]
fn resident() -> Option<usize> {
None
}
#[cfg(target_os = "linux")]
fn resident_segments() -> Vec<(String, usize)> {
use regex::Regex;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::fs::File;
use std::io::{BufRead, BufReader};
// The first line of an entry in /proc/<pid>/smaps looks just like an entry
// in /proc/<pid>/maps:
//
// address perms offset dev inode pathname
// 02366000-025d8000 rw-p 00000000 00:00 0 [heap]
//
// Each of the following lines contains a key and a value, separated
// by ": ", where the key does not contain either of those characters.
// For example:
//
// Rss: 132 kB
let f = match File::open("/proc/self/smaps") {
Ok(f) => BufReader::new(f),
Err(_) => return vec![],
};
let seg_re = Regex::new(
r"^[:xdigit:]+-[:xdigit:]+ (....) [:xdigit:]+ [:xdigit:]+:[:xdigit:]+ \d+ +(.*)",
)
.unwrap();
let rss_re = Regex::new(r"^Rss: +(\d+) kB").unwrap();
// We record each segment's resident size.
let mut seg_map: HashMap<String, usize> = HashMap::new();
#[derive(PartialEq)]
enum LookingFor {
Segment,
Rss,
}
let mut looking_for = LookingFor::Segment;
let mut curr_seg_name = String::new();
// Parse the file.
for line in f.lines() {
let line = match line {
Ok(line) => line,
Err(_) => continue,
};
if looking_for == LookingFor::Segment {
// Look for a segment info line.
let cap = match seg_re.captures(&line) {
Some(cap) => cap,
None => continue,
};
let perms = cap.get(1).unwrap().as_str();
let pathname = cap.get(2).unwrap().as_str();
// Construct the segment name from its pathname and permissions.
curr_seg_name.clear();
if pathname == "" || pathname.starts_with("[stack:") {
// Anonymous memory. Entries marked with "[stack:nnn]"
// look like thread stacks but they may include other
// anonymous mappings, so we can't trust them and just
// treat them as entirely anonymous.
curr_seg_name.push_str("anonymous");
} else {
curr_seg_name.push_str(pathname);
}
curr_seg_name.push_str(" (");
curr_seg_name.push_str(perms);
curr_seg_name.push_str(")");
looking_for = LookingFor::Rss;
} else {
// Look for an "Rss:" line.
let cap = match rss_re.captures(&line) {
Some(cap) => cap,
None => continue,
};
let rss = cap.get(1).unwrap().as_str().parse::<usize>().unwrap() * 1024;
if rss > 0 {
// Aggregate small segments into "other".
let seg_name = if rss < 512 * 1024 {
"other".to_owned()
} else {
curr_seg_name.clone()
};
match seg_map.entry(seg_name) {
Entry::Vacant(entry) => {
entry.insert(rss);
},
Entry::Occupied(mut entry) => *entry.get_mut() += rss,
}
}
looking_for = LookingFor::Segment;
}
}
// Note that the sum of all these segments' RSS values differs from the "resident"
// measurement obtained via /proc/<pid>/statm in resident(). It's unclear why this
// difference occurs; for some processes the measurements match, but for Servo they do not.
seg_map.into_iter().collect()
}
#[cfg(not(target_os = "linux"))]
fn resident_segments() -> Vec<(String, usize)> {
vec![]
}
}<|fim▁end|> | * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
<|file_name|>old2new.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
__author__ = 'Bright Pan'
# 注意:我们必须要把old数据库中的yehnet_customer表中的postdate改成add_time
import types
import urllib.request
try:
import simplejson as json
except Exception:
import json
import pymysql
import datetime
import sys
print(sys.getdefaultencoding())
def f(x):
if isinstance(x, str):
return x.encode("gbk", "ignore").decode("gbk")
return x
class DB(object):
def __init__(self, host="localhost", user="root", passwd="", old_db="", new_db="",charset="utf8"):
self.new_conn=pymysql.connect(host=host,user=user,passwd=passwd,db=new_db,charset=charset, cursorclass=pymysql.cursors.DictCursor)
self.old_conn=pymysql.connect(host=host,user=user,passwd=passwd,db=old_db,charset=charset, cursorclass=pymysql.cursors.DictCursor)
self.new_cur = self.new_conn.cursor()
self.old_cur = self.old_conn.cursor()
def db_clear_data(self):
self.new_cur.execute("show tables")
qs_new = self.new_cur.fetchall()
print(qs_new)
for each in qs_new:
self.new_cur.execute("truncate %s" % each['Tables_in_new'])
self.new_conn.commit()
def db_commit(self):
self.new_conn.commit()
self.old_conn.commit()
def table_copy_process(self, new_table="", old_table=""):
result = self.new_cur.execute("show columns from %s" % new_table)
qs_new = self.new_cur.fetchall()
new_cols = {}
for each in qs_new:
new_cols[each['Field']] = each
result = self.old_cur.execute("select * from %s" % old_table)
qs_old = self.old_cur.fetchall()
for each in qs_old:
sql_key = ""
sql_value = ""
for key,value in each.items():
#print(type(key),type(value))
cols_attr = new_cols.get(key)
#print(cols_attr)
if cols_attr:
if value is None:
#if cols_attr['Default'] is None:
#sql += "%s=''," % (key)
#sql_key += key + ','
pass
else:
if not cols_attr['Type'].find("date"):
#print(cols_attr)
if isinstance(value, datetime.datetime):
value = value.strftime("%Y-%m-%d %H:%M:%S")
else:
value = datetime.datetime.fromtimestamp(value).strftime("%Y-%m-%d %H:%M:%S")
#sql += "%s='%s'," % (key, value)
sql_key += "`%s`," % key
if isinstance(value, str):
sql_value += "\"%s\"," % pymysql.escape_string(value)
else:
sql_value += "\"%s\"," % value
sql = "INSERT INTO %s (%s) VALUES (%s)" % (new_table,sql_key[:-1],sql_value[:-1])
try:
self.new_cur.execute(sql)
#print(sql)
except pymysql.err.IntegrityError as e:
pass
#print(e)
#print(sql)
except pymysql.err.ProgrammingError as e: #捕捉除0异常
print(e)
self.db_commit()
def db_copy_process(self):
self.db_clear_data()
result = self.new_cur.execute("show tables")
new_tables = self.new_cur.fetchall()
new_tables_list = []
for each in new_tables:
new_tables_list.append(each["Tables_in_new"])
print(new_tables_list)
result = self.old_cur.execute("show tables")
old_tables = self.old_cur.fetchall()
old_tables_list = []
for each in old_tables:
old_tables_list.append(each["Tables_in_old"])
print(old_tables_list)
for each in new_tables_list:
print(each)
try:
old_tables_list.index(each)
new_tables_list.index(each)
except ValueError:
continue
self.table_copy_process(each, each)
def process_update(self, from_table='yehnet_sales', to_table="yehnet_admin", set_dict={}, where_condition=("adminid","id")):
map_dict = {"username":(0,"username"),
"email":(0,"email"),"phone":(0,"phone"),"company":(0,"company"),"department":(0,"department"),"job":(0,"job"),"add_time":(1,"add_time")}
if set_dict:
map_dict = set_dict
self.old_cur.execute("select * from %s" % from_table)
qs_old = self.old_cur.fetchall()
# self.new_cur.execute("select * from yehnet_admin")
# qs_new = self.new_cur.fetchall()
# new_dict = {}
# for each in qs_new:
# new_dict[each['admin_id']] = each
for each in qs_old:
#print(each)
sql = "UPDATE `%s` SET " % to_table
for from_cols, to_cols in map_dict.items():
key = to_cols[1]
value = each[from_cols]
if value is None:
pass
else:
if to_cols[0]:
if isinstance(value, str):
value = int(value)
value = datetime.datetime.fromtimestamp(value).strftime("%Y-%m-%d %H:%M:%S")
if isinstance(value, str):
sql += "`%s` = \"%s\"," % (key, pymysql.escape_string(value))
else:
sql += "`%s` = \"%s\"," % (key, value)
sql = sql[:-1] + " WHERE `%s` = \"%s\"" % (where_condition[1], each[where_condition[0]])
try:
#print(sql)
self.new_cur.execute(sql)
except pymysql.err.IntegrityError as e:
pass
#print(e)
#print(sql)
except pymysql.err.ProgrammingError as e: #捕捉除0异常
print(e)
self.db_commit()
def process_insert(self, from_table='yehnet_sales', to_table="yehnet_admin", set_dict={}, project=False):
map_dict = {"username":(0,"username"),
"email":(0,"email"),"phone":(0,"phone"),"company":(0,"company"),"department":(0,"department"),"job":(0,"job"),"add_time":(1,"add_time")}
if set_dict:
map_dict = set_dict
if project:
sql = "select * from %s " % (from_table)
sql += project
self.old_cur.execute(sql)
else:
self.old_cur.execute("select * from %s" % from_table)
qs_old = self.old_cur.fetchall()
# self.new_cur.execute("select * from yehnet_admin")
# qs_new = self.new_cur.fetchall()
# new_dict = {}
# for each in qs_new:
# new_dict[each['admin_id']] = each
for each in qs_old:
#print(list(map(f,list(each.keys()))))
sql_key = ""
sql_value = ""
for from_cols, to_cols in map_dict.items():
#print(from_cols,to_cols)
key = to_cols[1]
value = each[from_cols]
if value is None:
pass
else:
if to_cols[0] is 1:
if isinstance(value, str):
value = int(value)
value = datetime.datetime.fromtimestamp(value).strftime("%Y-%m-%d %H:%M:%S")
if to_cols[0] is 2:
value = to_cols[2]
if to_cols[0] is 3:
value = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
sql_key += "`%s`," % key
if isinstance(value, str):
sql_value += "\"%s\"," % pymysql.escape_string(value)
else:
sql_value += "\"%s\"," % value
# if isinstance(value, str):
# sql += "`%s` = \"%s\"," % (key, pymysql.escape_string(value))
# else:
# sql += "`%s` = \"%s\"," % (key, value)
sql = "INSERT INTO %s (%s) VALUES (%s)" % (to_table,sql_key[:-1],sql_value[:-1])
try:
#print(f(sql))
self.new_cur.execute(sql)
except pymysql.err.IntegrityError as e:
print(e)
#print(sql)
except pymysql.err.ProgrammingError as e: #捕捉除0异常
print(e)
self.db_commit()
def process_invalid_data(self):
try:
# print(sql)
self.new_cur.execute("update yehnet_customer_user set status = '3' where status = '2';")
self.new_cur.execute("update yehnet_customer_user set status = '2' where status = '1';")
self.new_cur.execute("update yehnet_customer_user set status = '1' where status = '0';")
#self.new_cur.execute("delete from yehnet_customer_admin where a_id = 0")
#self.new_cur.execute("delete from yehnet_customer_user where u_id = 0")
except pymysql.err.IntegrityError as e:
print(e)
#print(sql)
except pymysql.err.ProgrammingError as e: #捕捉除0异常
print(e)
self.new_conn.commit()
def __del__(self):
self.new_conn.close()
self.old_conn.close()
if __name__ == "__main__":
db = DB(old_db="old",new_db="new")
#db.table_copy_process("yehnet_admin", "yehnet_admin")
db.db_copy_process()
db.process_update()
from_table = "yehnet_customer"
to_table = "yehnet_customer_admin"
map_dict = {"id":(0,"c_id"), "guwenid":(0,"a_id"), "status":(2,"status",1), "add_time":(3,"add_time")}
db.process_insert(from_table,to_table,map_dict)
from_table = "yehnet_customer"
to_table = "yehnet_customer_project"
map_dict = {"id":(0,"c_id"), "uid":(0,"u_id"),"yehnet_list.id":(0,"p_id"),
"wanted":(0,"apartment"),"housetype":(0,"housetype"),
"housesquare":(0,"housesquare"),"housefloor":(0,"housefloor"),
"other":(0,"other"), "status":(2,"status",1), "add_time":(3,"add_time")}
db.process_insert(from_table,to_table,map_dict, "left JOIN yehnet_list ON yehnet_list.title = yehnet_customer.proname")
from_table = "yehnet_customer"
to_table = "yehnet_customer_user"
map_dict = {"id":(0,"c_id"), "uid":(0,"u_id"),"yongjin":(0,"commission"),"status":(0,"status"), "add_time":(0,"add_time")}
db.process_insert(from_table,to_table,map_dict, "left JOIN yehnet_list ON yehnet_list.title = yehnet_customer.proname")
from_table = "yehnet_customer_log"
to_table = "yehnet_customer_status"
map_dict = {"yehnet_customer.id":(0,"c_id"), "uid":(0,"u_id"), "guwenid":(0,"a_id"),"yehnet_list.id":(0,"p_id"), "type":(0,"type"), "note":(0,"remark"),"yehnet_customer.status":(0,"status"), "add_time":(1,"add_time")}
db.process_insert(from_table,to_table,map_dict, "left JOIN yehnet_customer ON yehnet_customer_log.customer_id = yehnet_customer.id left JOIN yehnet_list ON yehnet_list.title = yehnet_customer.proname")
from_table = "yehnet_user"
to_table = "yehnet_user"
map_dict = {"regdate":(3,"add_time")}<|fim▁hole|> to_table = "yehnet_user"
map_dict = {"jjr_city":(0,"jjr_city"), "jjr_province":(0,"jjr_province")}
db.process_update(from_table,to_table,map_dict, ('phone','phone'))
db.process_invalid_data()<|fim▁end|> | db.process_update(from_table,to_table,map_dict, ('id','id'))
from_table = "yehnet_user_bk" |
<|file_name|>create_sec_package.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python3
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###############################################################################<|fim▁hole|>import os
import sys
sys.path.append('/home/caros/secure_upgrade/python')
root_config_path = "/home/caros/secure_upgrade/config/secure_config.json"
ret = sec_api.init_secure_upgrade(root_config_path)
if ret is True:
print('Security environment init successfully!')
else:
print('Security environment init failed!')
exit(1)
homedir = os.environ['HOME']
release_tgz = homedir + '/.cache/apollo_release.tar.gz'
sec_release_tgz = homedir + '/.cache/sec_apollo_release.tar.gz'
package_token = homedir + '/.cache/package_token'
ret = sec_api.sec_upgrade_get_package(
release_tgz, sec_release_tgz, package_token)
if ret is True:
print('Security package generated successfully!')
else:
print('Security package generated failed!')<|fim▁end|> |
import secure_upgrade_export as sec_api |
<|file_name|>PermissionAccordion.tsx<|end_file_name|><|fim▁begin|>import {Accordion} from '@/components'
import {PermissionsAccordionTitle} from './PermissionsAccordionTitle'
import {PermissionsAccordionPanel} from '@/components/Permissions/Panel'
import {PermissionsAccordionProvider} from './context'
import type {Role} from '@/types/permissions'
export function PermissionsAccordion({roles}: {roles: Array<Role>}) {
return (<|fim▁hole|> <PermissionsAccordionTitle />
<PermissionsAccordionPanel />
</Accordion.Item>
</PermissionsAccordionProvider>
))}
</Accordion>
)
}<|fim▁end|> | <Accordion>
{roles.map(role => (
<PermissionsAccordionProvider role={role}>
<Accordion.Item key={role.name} openClasses="bg-gray-50"> |
<|file_name|>ResourceLabel.js<|end_file_name|><|fim▁begin|>var clover = new Object();
// JSON: {classes : [{name, id, sl, el, methods : [{sl, el}, ...]}, ...]}
clover.pageData = {"classes":[{"el":70,"id":245172,"methods":[{"el":61,"sc":2,"sl":48},{"el":65,"sc":2,"sl":63},{"el":69,"sc":2,"sl":67}],"name":"ResourceLabel","sl":33}]}
<|fim▁hole|>// JSON: { lines : [{tests : [testid1, testid2, testid3, ...]}, ...]};
clover.srcFileLines = [[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]<|fim▁end|> | // JSON: {test_ID : {"methods": [ID1, ID2, ID3...], "name" : "testXXX() void"}, ...};
clover.testTargets = {}
|
<|file_name|>sub_base.py<|end_file_name|><|fim▁begin|># Copyright 2014 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""Base test case for all tests.
To change behavoir only for tests that do not rely on Tempest, please
target the neutron.tests.base module instead.
There should be no non-test Neutron imports in this module to ensure
that the functional API tests can import Tempest without triggering
errors due to duplicate configuration definitions.
"""
import contextlib
import logging as std_logging
import os
import os.path
import random
import traceback
import eventlet.timeout
import fixtures
import mock
from oslo_utils import strutils
import testtools
from neutron.tests import post_mortem_debug
LOG_FORMAT = "%(asctime)s %(levelname)8s [%(name)s] %(message)s"
def get_rand_name(max_length=None, prefix='test'):
name = prefix + str(random.randint(1, 0x7fffffff))
return name[:max_length] if max_length is not None else name
def bool_from_env(key, strict=False, default=False):
value = os.environ.get(key)
return strutils.bool_from_string(value, strict=strict, default=default)
class SubBaseTestCase(testtools.TestCase):
def setUp(self):
super(SubBaseTestCase, self).setUp()
# Configure this first to ensure pm debugging support for setUp()
debugger = os.environ.get('OS_POST_MORTEM_DEBUGGER')
if debugger:
self.addOnException(post_mortem_debug.get_exception_handler(
debugger))
if bool_from_env('OS_DEBUG'):
_level = std_logging.DEBUG
else:
_level = std_logging.INFO
capture_logs = bool_from_env('OS_LOG_CAPTURE')
if not capture_logs:
std_logging.basicConfig(format=LOG_FORMAT, level=_level)
self.log_fixture = self.useFixture(
fixtures.FakeLogger(
format=LOG_FORMAT,
level=_level,
nuke_handlers=capture_logs,<|fim▁hole|> test_timeout = 0
if test_timeout > 0:
self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
# If someone does use tempfile directly, ensure that it's cleaned up
self.useFixture(fixtures.NestedTempfile())
self.useFixture(fixtures.TempHomeDir())
self.addCleanup(mock.patch.stopall)
if bool_from_env('OS_STDOUT_CAPTURE'):
stdout = self.useFixture(fixtures.StringStream('stdout')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout))
if bool_from_env('OS_STDERR_CAPTURE'):
stderr = self.useFixture(fixtures.StringStream('stderr')).stream
self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
self.addOnException(self.check_for_systemexit)
def check_for_systemexit(self, exc_info):
if isinstance(exc_info[1], SystemExit):
self.fail("A SystemExit was raised during the test. %s"
% traceback.format_exception(*exc_info))
@contextlib.contextmanager
def assert_max_execution_time(self, max_execution_time=5):
with eventlet.timeout.Timeout(max_execution_time, False):
yield
return
self.fail('Execution of this test timed out')
def assertOrderedEqual(self, expected, actual):
expect_val = self.sort_dict_lists(expected)
actual_val = self.sort_dict_lists(actual)
self.assertEqual(expect_val, actual_val)
def sort_dict_lists(self, dic):
for key, value in dic.iteritems():
if isinstance(value, list):
dic[key] = sorted(value)
elif isinstance(value, dict):
dic[key] = self.sort_dict_lists(value)
return dic
def assertDictSupersetOf(self, expected_subset, actual_superset):
"""Checks that actual dict contains the expected dict.
After checking that the arguments are of the right type, this checks
that each item in expected_subset is in, and matches, what is in
actual_superset. Separate tests are done, so that detailed info can
be reported upon failure.
"""
if not isinstance(expected_subset, dict):
self.fail("expected_subset (%s) is not an instance of dict" %
type(expected_subset))
if not isinstance(actual_superset, dict):
self.fail("actual_superset (%s) is not an instance of dict" %
type(actual_superset))
for k, v in expected_subset.items():
self.assertIn(k, actual_superset)
self.assertEqual(v, actual_superset[k],
"Key %(key)s expected: %(exp)r, actual %(act)r" %
{'key': k, 'exp': v, 'act': actual_superset[k]})<|fim▁end|> | ))
test_timeout = int(os.environ.get('OS_TEST_TIMEOUT', 0))
if test_timeout == -1: |
<|file_name|>interface.go<|end_file_name|><|fim▁begin|>// +build linux
package linux
import (
"os/exec"
"regexp"
"strings"
"github.com/mackerelio/mackerel-agent/logging"
"github.com/mackerelio/mackerel-agent/spec"
)
// InterfaceGenerator XXX
type InterfaceGenerator struct {
}
// Key XXX
func (g *InterfaceGenerator) Key() string {
return "interface"
}
var interfaceLogger = logging.GetLogger("spec.interface")
// Generate XXX
func (g *InterfaceGenerator) Generate() ([]spec.NetInterface, error) {
var interfaces spec.NetInterfaces
_, err := exec.LookPath("ip")
// has ip command
if err == nil {
interfaces, err = g.generateByIPCommand()
if err != nil {
return nil, err
}
} else {
interfaces, err = g.generateByIfconfigCommand()
if err != nil {
return nil, err
}
}
var results []spec.NetInterface
for _, iface := range interfaces {
if iface.Encap == "" || iface.Encap == "Loopback" {
continue
}
if len(iface.IPv4Addresses) == 0 && len(iface.IPv6Addresses) == 0 {
continue
}
results = append(results, iface)
}
return results, nil
}
var (
// ex.) 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
ipCmdNameReg = regexp.MustCompile(`^(\d+): ([0-9a-zA-Z@:\.\-_]*?)(@[0-9a-zA-Z]+|):\s`)
// ex.) link/ether 12:34:56:78:9a:bc brd ff:ff:ff:ff:ff:ff
ipCmdEncapReg = regexp.MustCompile(`link\/(\w+) ([\da-f\:]+) `)
// ex.) inet 10.0.4.7/24 brd 10.0.5.255 scope global eth0
ipCmdIPv4Reg = regexp.MustCompile(`inet (\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\/(\d{1,2}))?`)
//inet6 fe80::44b3:b3ff:fe1c:d17c/64 scope link
ipCmdIPv6Reg = regexp.MustCompile(`inet6 ([a-f0-9\:]+)\/(\d+) scope (\w+)`)
)
func (g *InterfaceGenerator) generateByIPCommand() (spec.NetInterfaces, error) {
interfaces := make(spec.NetInterfaces)
name := ""
{
// ip addr
out, err := exec.Command("ip", "addr").Output()
if err != nil {
interfaceLogger.Errorf("Failed to run ip command (skip this spec): %s", err)
return nil, err
}
for _, line := range strings.Split(string(out), "\n") {
if matches := ipCmdNameReg.FindStringSubmatch(line); matches != nil {
name = matches[2]
}
if matches := ipCmdEncapReg.FindStringSubmatch(line); matches != nil {
interfaces.SetEncap(name, translateEncap(matches[1]))
interfaces.SetMacAddress(name, matches[2])
}
if matches := ipCmdIPv4Reg.FindStringSubmatch(line); matches != nil {
interfaces.AppendIPv4Address(name, matches[1])
}
if matches := ipCmdIPv6Reg.FindStringSubmatch(line); matches != nil {
interfaces.AppendIPv6Address(name, matches[1])
}
}
}
for _, family := range []string{"inet", "inet6"} {
// ip -f inet route show
out, err := exec.Command("ip", "-f", family, "route", "show").Output()
if err != nil {
interfaceLogger.Errorf("Failed to run ip command (skip this spec): %s", err)
return interfaces, err
}
for _, line := range strings.Split(string(out), "\n") {
name, addr, v6addr, defaultGateway := parseIProuteLine(line)
if name == "" {
continue
}
if addr != "" {
interfaces.SetAddress(name, addr)
}
if v6addr != "" {
interfaces.SetV6Address(name, v6addr)
}
if defaultGateway != "" {
interfaces.SetDefaultGateway(name, defaultGateway)
}
}
}
return interfaces, nil
}
var (
// ex.) 10.0.3.0/24 dev eth0 proto kernel scope link src 10.0.4.7
// ex.) fe80::/64 dev eth0 proto kernel metric 256
ipRouteLineReg = regexp.MustCompile(`^([^\s]+)\s(.*)$`)
ipRouteDeviceReg = regexp.MustCompile(`\bdev\s+([^\s]+)\b`)
// ex.) 10.0.3.0/24
ipRouteIPv4Reg = regexp.MustCompile(`(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(\/(\d{1,2}))?`)
// ex.) fe80::/64
ipRouteIPv6Reg = regexp.MustCompile(`([a-f0-9\:]+)\/(\d+)`)
// ex.) default via 10.0.3.1 dev eth0
ipRouteDefaultGatewayReg = regexp.MustCompile(`\bvia\s+([^\s]+)\b`)
)
func parseIProuteLine(line string) (name, addr, v6addr, defaultGateway string) {
matches := ipRouteLineReg.FindStringSubmatch(line)
if matches == nil && len(matches) < 3 {
return
}
if matches := ipRouteDeviceReg.FindStringSubmatch(matches[2]); matches != nil {
name = matches[1]
} else {
return
}
if matches := ipRouteIPv4Reg.FindStringSubmatch(matches[1]); matches != nil {
addr = matches[1]
}
if matches := ipRouteIPv6Reg.FindStringSubmatch(matches[1]); matches != nil {
v6addr = matches[1]
}
if matches := ipRouteDefaultGatewayReg.FindStringSubmatch(matches[2]); matches != nil {
defaultGateway = matches[1]
}
return
}
var (
// ex.) eth0 Link encap:Ethernet HWaddr 12:34:56:78:9a:bc
ifconfigNameReg = regexp.MustCompile(`^([0-9a-zA-Z@\.\:\-_]+)\s+`)
// ex.) eth0 Link encap:Ethernet HWaddr 12:34:56:78:9a:bc
ifconfigEncapReg = regexp.MustCompile(`Link encap:(Local Loopback)|Link encap:(.+?)\s`)
// ex.) eth0 Link encap:Ethernet HWaddr 00:16:3e:4f:f3:41
ifconfigMacAddrReg = regexp.MustCompile(`HWaddr (.+?)\s`)
// ex.) inet addr:10.0.4.7 Bcast:10.0.5.255 Mask:255.255.255.0
ifconfigV4AddrReg = regexp.MustCompile(`inet addr:(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})`)
// ex.) inet6 addr: fe80::44b3:b3ff:fe1c:d17c/64 Scope:Link
ifconfigV6AddrReg = regexp.MustCompile(`inet6 addr: ([a-f0-9\:]+)\/(\d+) Scope:(\w+)`)
)
func (g *InterfaceGenerator) generateByIfconfigCommand() (spec.NetInterfaces, error) {
interfaces := make(spec.NetInterfaces)
name := ""
{
// ifconfig -a
out, err := exec.Command("ifconfig", "-a").Output()
if err != nil {
interfaceLogger.Errorf("Failed to run ifconfig command (skip this spec): %s", err)
return nil, err
}
for _, line := range strings.Split(string(out), "\n") {<|fim▁hole|> if matches := ifconfigEncapReg.FindStringSubmatch(line); matches != nil {
encap := matches[1]
if encap == "" {
encap = matches[2]
}
interfaces.SetEncap(name, translateEncap(encap))
}
if matches := ifconfigMacAddrReg.FindStringSubmatch(line); matches != nil {
interfaces.SetMacAddress(name, matches[1])
}
if matches := ifconfigV4AddrReg.FindStringSubmatch(line); matches != nil {
interfaces.AppendIPv4Address(name, matches[1])
}
if matches := ifconfigV6AddrReg.FindStringSubmatch(line); matches != nil {
interfaces.AppendIPv6Address(name, matches[1])
}
}
}
{
// route -n
out, err := exec.Command("route", "-n").Output()
if err != nil {
interfaceLogger.Errorf("Failed to run route command (skip this spec): %s", err)
return interfaces, err
}
for _, line := range strings.Split(string(out), "\n") {
name, defaultGateway := parseRouteLine(line)
if name == "" {
continue
}
interfaces.SetDefaultGateway(name, defaultGateway)
}
}
{
// arp -an
out, err := exec.Command("arp", "-an").Output()
if err != nil {
interfaceLogger.Errorf("Failed to run arp command (skip this spec): %s", err)
return interfaces, err
}
for _, line := range strings.Split(string(out), "\n") {
name, addr := parseArpLine(line)
if name == "" {
continue
}
interfaces.SetAddress(name, addr)
}
}
return interfaces, nil
}
// Destination Gateway Genmask Flags Metric Ref Use Iface
// 0.0.0.0 10.0.3.1 0.0.0.0 UG 0 0 0 eth0
func parseRouteLine(line string) (name, defaultGateway string) {
if !strings.HasPrefix(line, "0.0.0.0") {
return
}
routeResults := strings.Fields(line)
if len(routeResults) < 8 {
return
}
return routeResults[7], routeResults[1]
}
// ex.) ? (10.0.3.2) at 01:23:45:67:89:ab [ether] on eth0
var arpRegexp = regexp.MustCompile(`^\S+ \((\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\) at ([a-fA-F0-9\:]+) \[(\w+)\] on ([0-9a-zA-Z\.\:\-]+)`)
func parseArpLine(line string) (name, addr string) {
if matches := arpRegexp.FindStringSubmatch(line); matches != nil {
return matches[4], matches[1]
}
return
}
func translateEncap(encap string) string {
switch encap {
case "Local Loopback", "loopback":
return "Loopback"
case "Point-to-Point Protocol":
return "PPP"
case "Serial Line IP":
return "SLIP"
case "VJ Serial Line IP":
return "VJSLIP"
case "IPIP Tunnel":
return "IPIP"
case "IPv6-in-IPv4":
return "6to4"
case "ether":
return "Ethernet"
}
return encap
}<|fim▁end|> | if matches := ifconfigNameReg.FindStringSubmatch(line); matches != nil {
name = matches[1]
} |
<|file_name|>test_migrations.py<|end_file_name|><|fim▁begin|># Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
"""
Tests for database migrations.
There are "opportunistic" tests which allows testing against all 3 databases
(sqlite in memory, mysql, pg) in a properly configured unit test environment.
For the opportunistic testing you need to set up db's named 'openstack_citest'
with user 'openstack_citest' and password 'openstack_citest' on localhost. The
test will then use that db and u/p combo to run the tests.
For postgres on Ubuntu this can be done with the following commands::
| sudo -u postgres psql
| postgres=# create user openstack_citest with createdb login password
| 'openstack_citest';
| postgres=# create database openstack_citest with owner openstack_citest;
"""
import glob
import logging
import os
from migrate.versioning import repository
import mock
from oslo.db.sqlalchemy import test_base
from oslo.db.sqlalchemy import test_migrations
from oslo.db.sqlalchemy import utils as oslodbutils
import sqlalchemy
from sqlalchemy.engine import reflection
import sqlalchemy.exc
from sqlalchemy.sql import null
from nova.db import migration
from nova.db.sqlalchemy import migrate_repo
from nova.db.sqlalchemy import migration as sa_migration
from nova.db.sqlalchemy import utils as db_utils
from nova import exception
from nova.i18n import _
from nova import test
LOG = logging.getLogger(__name__)
class NovaMigrationsCheckers(test_migrations.WalkVersionsMixin):
"""Test sqlalchemy-migrate migrations."""
TIMEOUT_SCALING_FACTOR = 2
snake_walk = True
downgrade = True
@property
def INIT_VERSION(self):
return migration.db_initial_version()
@property
def REPOSITORY(self):
return repository.Repository(
os.path.abspath(os.path.dirname(migrate_repo.__file__)))
@property
def migration_api(self):
return sa_migration.versioning_api
@property
def migrate_engine(self):
return self.engine
def setUp(self):
super(NovaMigrationsCheckers, self).setUp()
# NOTE(viktors): We should reduce log output because it causes issues,
# when we run tests with testr
migrate_log = logging.getLogger('migrate')
old_level = migrate_log.level
migrate_log.setLevel(logging.WARN)
self.addCleanup(migrate_log.setLevel, old_level)
def assertColumnExists(self, engine, table_name, column):
self.assertTrue(oslodbutils.column_exists(engine, table_name, column))
def assertColumnNotExists(self, engine, table_name, column):
self.assertFalse(oslodbutils.column_exists(engine, table_name, column))
def assertTableNotExists(self, engine, table):
self.assertRaises(sqlalchemy.exc.NoSuchTableError,
oslodbutils.get_table, engine, table)
def assertIndexExists(self, engine, table_name, index):
self.assertTrue(oslodbutils.index_exists(engine, table_name, index))
def assertIndexMembers(self, engine, table, index, members):
# NOTE(johannes): Order of columns can matter. Most SQL databases
# can use the leading columns for optimizing queries that don't
# include all of the covered columns.
self.assertIndexExists(engine, table, index)
t = oslodbutils.get_table(engine, table)
index_columns = None
for idx in t.indexes:
if idx.name == index:
index_columns = [c.name for c in idx.columns]
break
self.assertEqual(members, index_columns)
def _skippable_migrations(self):
special = [
216, # Havana
]
havana_placeholders = range(217, 227)
icehouse_placeholders = range(235, 244)
juno_placeholders = range(255, 265)
return (special +
havana_placeholders +
icehouse_placeholders +
juno_placeholders)
def migrate_up(self, version, with_data=False):
if with_data:
check = getattr(self, "_check_%03d" % version, None)
if version not in self._skippable_migrations():
self.assertIsNotNone(check,
('DB Migration %i does not have a '
'test. Please add one!') % version)
super(NovaMigrationsCheckers, self).migrate_up(version, with_data)
def test_walk_versions(self):
self.walk_versions(self.snake_walk, self.downgrade)
def _check_227(self, engine, data):
table = oslodbutils.get_table(engine, 'project_user_quotas')
# Insert fake_quotas with the longest resource name.
fake_quotas = {'id': 5,
'project_id': 'fake_project',
'user_id': 'fake_user',
'resource': 'injected_file_content_bytes',
'hard_limit': 10}
table.insert().execute(fake_quotas)
# Check we can get the longest resource name.
quota = table.select(table.c.id == 5).execute().first()
self.assertEqual(quota['resource'], 'injected_file_content_bytes')
def _check_228(self, engine, data):
self.assertColumnExists(engine, 'compute_nodes', 'metrics')
compute_nodes = oslodbutils.get_table(engine, 'compute_nodes')
self.assertIsInstance(compute_nodes.c.metrics.type,
sqlalchemy.types.Text)
def _post_downgrade_228(self, engine):
self.assertColumnNotExists(engine, 'compute_nodes', 'metrics')
def _check_229(self, engine, data):
self.assertColumnExists(engine, 'compute_nodes', 'extra_resources')
compute_nodes = oslodbutils.get_table(engine, 'compute_nodes')
self.assertIsInstance(compute_nodes.c.extra_resources.type,
sqlalchemy.types.Text)
def _post_downgrade_229(self, engine):
self.assertColumnNotExists(engine, 'compute_nodes', 'extra_resources')
def _check_230(self, engine, data):
for table_name in ['instance_actions_events',
'shadow_instance_actions_events']:
self.assertColumnExists(engine, table_name, 'host')
self.assertColumnExists(engine, table_name, 'details')
action_events = oslodbutils.get_table(engine,
'instance_actions_events')
self.assertIsInstance(action_events.c.host.type,
sqlalchemy.types.String)
self.assertIsInstance(action_events.c.details.type,
sqlalchemy.types.Text)
def _post_downgrade_230(self, engine):
for table_name in ['instance_actions_events',
'shadow_instance_actions_events']:
self.assertColumnNotExists(engine, table_name, 'host')
self.assertColumnNotExists(engine, table_name, 'details')
def _check_231(self, engine, data):
self.assertColumnExists(engine, 'instances', 'ephemeral_key_uuid')
instances = oslodbutils.get_table(engine, 'instances')
self.assertIsInstance(instances.c.ephemeral_key_uuid.type,
sqlalchemy.types.String)
self.assertTrue(db_utils.check_shadow_table(engine, 'instances'))
def _post_downgrade_231(self, engine):
self.assertColumnNotExists(engine, 'instances', 'ephemeral_key_uuid')
self.assertTrue(db_utils.check_shadow_table(engine, 'instances'))
def _check_232(self, engine, data):
table_names = ['compute_node_stats', 'compute_nodes',
'instance_actions', 'instance_actions_events',
'instance_faults', 'migrations']
for table_name in table_names:
self.assertTableNotExists(engine, 'dump_' + table_name)
def _check_233(self, engine, data):
self.assertColumnExists(engine, 'compute_nodes', 'stats')
compute_nodes = oslodbutils.get_table(engine, 'compute_nodes')
self.assertIsInstance(compute_nodes.c.stats.type,
sqlalchemy.types.Text)
self.assertRaises(sqlalchemy.exc.NoSuchTableError,
oslodbutils.get_table, engine, 'compute_node_stats')
def _post_downgrade_233(self, engine):
self.assertColumnNotExists(engine, 'compute_nodes', 'stats')
# confirm compute_node_stats exists
oslodbutils.get_table(engine, 'compute_node_stats')
def _check_234(self, engine, data):
self.assertIndexMembers(engine, 'reservations',
'reservations_deleted_expire_idx',
['deleted', 'expire'])
def _check_244(self, engine, data):
volume_usage_cache = oslodbutils.get_table(
engine, 'volume_usage_cache')
self.assertEqual(64, volume_usage_cache.c.user_id.type.length)
def _post_downgrade_244(self, engine):
volume_usage_cache = oslodbutils.get_table(
engine, 'volume_usage_cache')
self.assertEqual(36, volume_usage_cache.c.user_id.type.length)
def _pre_upgrade_245(self, engine):
# create a fake network
networks = oslodbutils.get_table(engine, 'networks')
fake_network = {'id': 1}
networks.insert().execute(fake_network)
def _check_245(self, engine, data):
networks = oslodbutils.get_table(engine, 'networks')
network = networks.select(networks.c.id == 1).execute().first()
# mtu should default to None
self.assertIsNone(network.mtu)
# dhcp_server should default to None
self.assertIsNone(network.dhcp_server)
# enable dhcp should default to true
self.assertTrue(network.enable_dhcp)
# share address should default to false
self.assertFalse(network.share_address)
def _post_downgrade_245(self, engine):
self.assertColumnNotExists(engine, 'networks', 'mtu')
self.assertColumnNotExists(engine, 'networks', 'dhcp_server')
self.assertColumnNotExists(engine, 'networks', 'enable_dhcp')
self.assertColumnNotExists(engine, 'networks', 'share_address')
def _check_246(self, engine, data):
pci_devices = oslodbutils.get_table(engine, 'pci_devices')
self.assertEqual(1, len([fk for fk in pci_devices.foreign_keys
if fk.parent.name == 'compute_node_id']))
def _post_downgrade_246(self, engine):
pci_devices = oslodbutils.get_table(engine, 'pci_devices')
self.assertEqual(0, len([fk for fk in pci_devices.foreign_keys
if fk.parent.name == 'compute_node_id']))
def _check_247(self, engine, data):
quota_usages = oslodbutils.get_table(engine, 'quota_usages')
self.assertFalse(quota_usages.c.resource.nullable)
pci_devices = oslodbutils.get_table(engine, 'pci_devices')
self.assertTrue(pci_devices.c.deleted.nullable)
self.assertFalse(pci_devices.c.product_id.nullable)
self.assertFalse(pci_devices.c.vendor_id.nullable)
self.assertFalse(pci_devices.c.dev_type.nullable)
def _post_downgrade_247(self, engine):
quota_usages = oslodbutils.get_table(engine, 'quota_usages')
self.assertTrue(quota_usages.c.resource.nullable)
pci_devices = oslodbutils.get_table(engine, 'pci_devices')
self.assertFalse(pci_devices.c.deleted.nullable)
self.assertTrue(pci_devices.c.product_id.nullable)
self.assertTrue(pci_devices.c.vendor_id.nullable)
self.assertTrue(pci_devices.c.dev_type.nullable)
def _check_248(self, engine, data):
self.assertIndexMembers(engine, 'reservations',
'reservations_deleted_expire_idx',
['deleted', 'expire'])
def _post_downgrade_248(self, engine):
reservations = oslodbutils.get_table(engine, 'reservations')
index_names = [idx.name for idx in reservations.indexes]
self.assertNotIn('reservations_deleted_expire_idx', index_names)
def _check_249(self, engine, data):
# Assert that only one index exists that covers columns
# instance_uuid and device_name
bdm = oslodbutils.get_table(engine, 'block_device_mapping')
self.assertEqual(1, len([i for i in bdm.indexes
if [c.name for c in i.columns] ==
['instance_uuid', 'device_name']]))
def _post_downgrade_249(self, engine):
# The duplicate index is not created on downgrade, so this
# asserts that only one index exists that covers columns
# instance_uuid and device_name
bdm = oslodbutils.get_table(engine, 'block_device_mapping')
self.assertEqual(1, len([i for i in bdm.indexes
if [c.name for c in i.columns] ==
['instance_uuid', 'device_name']]))
def _check_250(self, engine, data):
self.assertTableNotExists(engine, 'instance_group_metadata')
self.assertTableNotExists(engine, 'shadow_instance_group_metadata')
def _post_downgrade_250(self, engine):
oslodbutils.get_table(engine, 'instance_group_metadata')
oslodbutils.get_table(engine, 'shadow_instance_group_metadata')
def _check_251(self, engine, data):
self.assertColumnExists(engine, 'compute_nodes', 'numa_topology')
self.assertColumnExists(engine, 'shadow_compute_nodes',
'numa_topology')
compute_nodes = oslodbutils.get_table(engine, 'compute_nodes')
shadow_compute_nodes = oslodbutils.get_table(engine,
'shadow_compute_nodes')
self.assertIsInstance(compute_nodes.c.numa_topology.type,
sqlalchemy.types.Text)
self.assertIsInstance(shadow_compute_nodes.c.numa_topology.type,
sqlalchemy.types.Text)
def _post_downgrade_251(self, engine):
self.assertColumnNotExists(engine, 'compute_nodes', 'numa_topology')
self.assertColumnNotExists(engine, 'shadow_compute_nodes',
'numa_topology')
def _check_252(self, engine, data):
oslodbutils.get_table(engine, 'instance_extra')
oslodbutils.get_table(engine, 'shadow_instance_extra')
self.assertIndexMembers(engine, 'instance_extra',
'instance_extra_idx',
['instance_uuid'])
def _post_downgrade_252(self, engine):
self.assertTableNotExists(engine, 'instance_extra')
self.assertTableNotExists(engine, 'shadow_instance_extra')
def _check_253(self, engine, data):
self.assertColumnExists(engine, 'instance_extra', 'pci_requests')
self.assertColumnExists(
engine, 'shadow_instance_extra', 'pci_requests')
instance_extra = oslodbutils.get_table(engine, 'instance_extra')
shadow_instance_extra = oslodbutils.get_table(engine,
'shadow_instance_extra')
self.assertIsInstance(instance_extra.c.pci_requests.type,
sqlalchemy.types.Text)
self.assertIsInstance(shadow_instance_extra.c.pci_requests.type,
sqlalchemy.types.Text)
def _post_downgrade_253(self, engine):
self.assertColumnNotExists(engine, 'instance_extra', 'pci_requests')
self.assertColumnNotExists(engine, 'shadow_instance_extra',
'pci_requests')
def _check_254(self, engine, data):
self.assertColumnExists(engine, 'pci_devices', 'request_id')
self.assertColumnExists(
engine, 'shadow_pci_devices', 'request_id')
pci_devices = oslodbutils.get_table(engine, 'pci_devices')
shadow_pci_devices = oslodbutils.get_table(
engine, 'shadow_pci_devices')
self.assertIsInstance(pci_devices.c.request_id.type,
sqlalchemy.types.String)
self.assertIsInstance(shadow_pci_devices.c.request_id.type,
sqlalchemy.types.String)
def _post_downgrade_254(self, engine):
self.assertColumnNotExists(engine, 'pci_devices', 'request_id')
self.assertColumnNotExists(
engine, 'shadow_pci_devices', 'request_id')
def _check_265(self, engine, data):
# Assert that only one index exists that covers columns
# host and deleted
instances = oslodbutils.get_table(engine, 'instances')
self.assertEqual(1, len([i for i in instances.indexes
if [c.name for c in i.columns][:2] ==
['host', 'deleted']]))
# and only one index covers host column
iscsi_targets = oslodbutils.get_table(engine, 'iscsi_targets')
self.assertEqual(1, len([i for i in iscsi_targets.indexes
if [c.name for c in i.columns][:1] ==
['host']]))
def _post_downgrade_265(self, engine):
# The duplicated index is not created on downgrade, so this
# asserts that only one index exists that covers columns
# host and deleted
instances = oslodbutils.get_table(engine, 'instances')
self.assertEqual(1, len([i for i in instances.indexes
if [c.name for c in i.columns][:2] ==
['host', 'deleted']]))
# and only one index covers host column
iscsi_targets = oslodbutils.get_table(engine, 'iscsi_targets')
self.assertEqual(1, len([i for i in iscsi_targets.indexes
if [c.name for c in i.columns][:1] ==
['host']]))
def _check_266(self, engine, data):
self.assertColumnExists(engine, 'tags', 'resource_id')
self.assertColumnExists(engine, 'tags', 'tag')
table = oslodbutils.get_table(engine, 'tags')
self.assertIsInstance(table.c.resource_id.type,
sqlalchemy.types.String)
self.assertIsInstance(table.c.tag.type,
sqlalchemy.types.String)
def _post_downgrade_266(self, engine):
self.assertTableNotExists(engine, 'tags')
def _pre_upgrade_267(self, engine):
# Create a fixed_ips row with a null instance_uuid (if not already
# there) to make sure that's not deleted.
fixed_ips = oslodbutils.get_table(engine, 'fixed_ips')
fake_fixed_ip = {'id': 1}
fixed_ips.insert().execute(fake_fixed_ip)
# Create an instance record with a valid (non-null) UUID so we make
# sure we don't do something stupid and delete valid records.
instances = oslodbutils.get_table(engine, 'instances')
fake_instance = {'id': 1, 'uuid': 'fake-non-null-uuid'}
instances.insert().execute(fake_instance)
# Add a null instance_uuid entry for the volumes table
# since it doesn't have a foreign key back to the instances table.
volumes = oslodbutils.get_table(engine, 'volumes')
fake_volume = {'id': '9c3c317e-24db-4d57-9a6f-96e6d477c1da'}
volumes.insert().execute(fake_volume)
def _check_267(self, engine, data):
# Make sure the column is non-nullable and the UC exists.
fixed_ips = oslodbutils.get_table(engine, 'fixed_ips')
self.assertTrue(fixed_ips.c.instance_uuid.nullable)
fixed_ip = fixed_ips.select(fixed_ips.c.id == 1).execute().first()
self.assertIsNone(fixed_ip.instance_uuid)
instances = oslodbutils.get_table(engine, 'instances')
self.assertFalse(instances.c.uuid.nullable)
inspector = reflection.Inspector.from_engine(engine)
constraints = inspector.get_unique_constraints('instances')
constraint_names = [constraint['name'] for constraint in constraints]
self.assertIn('uniq_instances0uuid', constraint_names)
# Make sure the instances record with the valid uuid is still there.
instance = instances.select(instances.c.id == 1).execute().first()
self.assertIsNotNone(instance)
# Check that the null entry in the volumes table is still there since
# we skipped tables that don't have FK's back to the instances table.
volumes = oslodbutils.get_table(engine, 'volumes')
self.assertTrue(volumes.c.instance_uuid.nullable)
volume = fixed_ips.select(
volumes.c.id == '9c3c317e-24db-4d57-9a6f-96e6d477c1da'
).execute().first()
self.assertIsNone(volume.instance_uuid)
def _post_downgrade_267(self, engine):
# Make sure the UC is gone and the column is nullable again.
instances = oslodbutils.get_table(engine, 'instances')
self.assertTrue(instances.c.uuid.nullable)
inspector = reflection.Inspector.from_engine(engine)
constraints = inspector.get_unique_constraints('instances')
constraint_names = [constraint['name'] for constraint in constraints]
self.assertNotIn('uniq_instances0uuid', constraint_names)
def test_migration_267(self):
# This is separate from test_walk_versions so we can test the case
# where there are non-null instance_uuid entries in the database which
# cause the 267 migration to fail.
engine = self.migrate_engine
self.migration_api.version_control(
engine, self.REPOSITORY, self.INIT_VERSION)
self.migration_api.upgrade(engine, self.REPOSITORY, 266)
# Create a consoles record with a null instance_uuid so
# we can test that the upgrade fails if that entry is found.
# NOTE(mriedem): We use the consoles table since that's the only table
# created in the 216 migration with a ForeignKey created on the
# instance_uuid table for sqlite.
consoles = oslodbutils.get_table(engine, 'consoles')
fake_console = {'id': 1}
consoles.insert().execute(fake_console)
# NOTE(mriedem): We handle the 267 migration where we expect to
# hit a ValidationError on the consoles table to have
# a null instance_uuid entry
ex = self.assertRaises(exception.ValidationError,
self.migration_api.upgrade,<|fim▁hole|> "'consoles' table where the uuid or "
"instance_uuid column is NULL.",
ex.kwargs['detail'])
# Remove the consoles entry with the null instance_uuid column.
rows = consoles.delete().where(
consoles.c['instance_uuid'] == null()).execute().rowcount
self.assertEqual(1, rows)
# Now run the 267 upgrade again.
self.migration_api.upgrade(engine, self.REPOSITORY, 267)
# Make sure the consoles entry with the null instance_uuid
# was deleted.
console = consoles.select(consoles.c.id == 1).execute().first()
self.assertIsNone(console)
def _check_268(self, engine, data):
# We can only assert that the col exists, not the unique constraint
# as the engine is running sqlite
self.assertColumnExists(engine, 'compute_nodes', 'host')
self.assertColumnExists(engine, 'shadow_compute_nodes', 'host')
compute_nodes = oslodbutils.get_table(engine, 'compute_nodes')
shadow_compute_nodes = oslodbutils.get_table(
engine, 'shadow_compute_nodes')
self.assertIsInstance(compute_nodes.c.host.type,
sqlalchemy.types.String)
self.assertIsInstance(shadow_compute_nodes.c.host.type,
sqlalchemy.types.String)
def _post_downgrade_268(self, engine):
self.assertColumnNotExists(engine, 'compute_nodes', 'host')
self.assertColumnNotExists(engine, 'shadow_compute_nodes', 'host')
def _check_269(self, engine, data):
self.assertColumnExists(engine, 'pci_devices', 'numa_node')
self.assertColumnExists(engine, 'shadow_pci_devices', 'numa_node')
pci_devices = oslodbutils.get_table(engine, 'pci_devices')
shadow_pci_devices = oslodbutils.get_table(
engine, 'shadow_pci_devices')
self.assertIsInstance(pci_devices.c.numa_node.type,
sqlalchemy.types.Integer)
self.assertTrue(pci_devices.c.numa_node.nullable)
self.assertIsInstance(shadow_pci_devices.c.numa_node.type,
sqlalchemy.types.Integer)
self.assertTrue(shadow_pci_devices.c.numa_node.nullable)
def _post_downgrade_269(self, engine):
self.assertColumnNotExists(engine, 'pci_devices', 'numa_node')
self.assertColumnNotExists(engine, 'shadow_pci_devices', 'numa_node')
class TestNovaMigrationsSQLite(NovaMigrationsCheckers,
test.TestCase,
test_base.DbTestCase):
pass
class TestNovaMigrationsMySQL(NovaMigrationsCheckers,
test.TestCase,
test_base.MySQLOpportunisticTestCase):
def test_innodb_tables(self):
with mock.patch.object(sa_migration, 'get_engine',
return_value=self.migrate_engine):
sa_migration.db_sync()
total = self.migrate_engine.execute(
"SELECT count(*) "
"FROM information_schema.TABLES "
"WHERE TABLE_SCHEMA = '%(database)s'" %
{'database': self.migrate_engine.url.database})
self.assertTrue(total.scalar() > 0, "No tables found. Wrong schema?")
noninnodb = self.migrate_engine.execute(
"SELECT count(*) "
"FROM information_schema.TABLES "
"WHERE TABLE_SCHEMA='%(database)s' "
"AND ENGINE != 'InnoDB' "
"AND TABLE_NAME != 'migrate_version'" %
{'database': self.migrate_engine.url.database})
count = noninnodb.scalar()
self.assertEqual(count, 0, "%d non InnoDB tables created" % count)
class TestNovaMigrationsPostgreSQL(NovaMigrationsCheckers,
test.TestCase,
test_base.PostgreSQLOpportunisticTestCase):
pass
class ProjectTestCase(test.NoDBTestCase):
def test_all_migrations_have_downgrade(self):
topdir = os.path.normpath(os.path.dirname(__file__) + '/../../../')
py_glob = os.path.join(topdir, "nova", "db", "sqlalchemy",
"migrate_repo", "versions", "*.py")
missing_downgrade = []
for path in glob.iglob(py_glob):
has_upgrade = False
has_downgrade = False
with open(path, "r") as f:
for line in f:
if 'def upgrade(' in line:
has_upgrade = True
if 'def downgrade(' in line:
has_downgrade = True
if has_upgrade and not has_downgrade:
fname = os.path.basename(path)
missing_downgrade.append(fname)
helpful_msg = (_("The following migrations are missing a downgrade:"
"\n\t%s") % '\n\t'.join(sorted(missing_downgrade)))
self.assertFalse(missing_downgrade, helpful_msg)<|fim▁end|> | engine, self.REPOSITORY, 267)
self.assertIn("There are 1 records in the " |
<|file_name|>nsistags.py<|end_file_name|><|fim▁begin|>###############################################################################
# Name: nsistags.py #
# Purpose: Generate Tags for Nullsoft Installer Scripts #
# Author: Cody Precord <[email protected]> #
# Copyright: (c) 2008 Cody Precord <[email protected]> #
# License: wxWindows License #
###############################################################################
"""
FILE: nsistags.py
AUTHOR: Cody Precord
LANGUAGE: Python
SUMMARY:
Generate a DocStruct object that captures the structure of a NSIS Script. It
currently supports generating tags for Sections, Functions, and Macro defs.
"""
__author__ = "Cody Precord <[email protected]>"
__svnid__ = "$Id: nsistags.py 52675 2008-03-22 03:34:38Z CJP $"
__revision__ = "$Revision: 52675 $"
#--------------------------------------------------------------------------#
# Dependancies
import taglib
import parselib
#--------------------------------------------------------------------------#
def GenerateTags(buff):
"""Create a DocStruct object that represents a NSIS Script
@param buff: a file like buffer object (StringIO)
@todo: generate tags for lua tables?
"""
rtags = taglib.DocStruct()
# Set Descriptions of Document Element Types
rtags.SetElementDescription('variable', "Defines")
rtags.SetElementDescription('section', "Section Definitions")
rtags.SetElementDescription('macro', "Macro Definitions")
rtags.SetElementDescription('function', "Function Definitions")
rtags.SetElementPriority('variable', 4)
rtags.SetElementPriority('section', 3)
rtags.SetElementPriority('function', 2)
rtags.SetElementPriority('macro', 1)
# Parse the lines for code objects
for lnum, line in enumerate(buff):
line = line.strip()
llen = len(line)
# Skip comment and empty lines
if line.startswith(u"#") or line.startswith(u";") or not line:
continue
# Look for functions and sections
if parselib.IsToken(line, 0, u'Function'):
parts = line.split()
if len(parts) > 1:
rtags.AddFunction(taglib.Function(parts[1], lnum))
elif parselib.IsToken(line, 0, u'Section'):
parts = line.split()
if len(parts) > 1 and parts[1][0] not in ['"', "'", "`"]:
rtags.AddElement('section', taglib.Section(parts[1], lnum))
else:
for idx, part in enumerate(parts[1:]):
if parts[idx][-1] in ['"', "'", "`"]:
rtags.AddElement('section', taglib.Section(part, lnum))
break
elif parselib.IsToken(line, 0, u'!macro'):
parts = line.split()
if len(parts) > 1:
rtags.AddElement('macro', taglib.Macro(parts[1], lnum))
elif parselib.IsToken(line, 0, u'!define'):
parts = line.split()
if len(parts) > 1 and parts[1][0].isalpha():
rtags.AddVariable(taglib.Variable(parts[1], lnum))
else:
continue
return rtags
#-----------------------------------------------------------------------------#
# Test
if __name__ == '__main__':
import sys
import StringIO
fhandle = open(sys.argv[1])<|fim▁hole|> fhandle.close()
tags = GenerateTags(StringIO.StringIO(txt))
print "\n\nElements:"
for element in tags.GetElements():
print "\n%s:" % element.keys()[0]
for val in element.values()[0]:
print "%s [%d]" % (val.GetName(), val.GetLine())
print "END"<|fim▁end|> | txt = fhandle.read() |
<|file_name|>EjbJar.java<|end_file_name|><|fim▁begin|>/*
* Copyright (c) 1998-2012 Caucho Technology -- all rights reserved
*
* This file is part of Resin(R) Open Source
*
* Each copy or derived work must preserve the copyright notice and this
* notice unmodified.
*
* Resin Open Source is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Resin Open Source is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, or any warranty
* of NON-INFRINGEMENT. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License
* along with Resin Open Source; if not, write to the
* Free SoftwareFoundation, Inc.
* 59 Temple Place, Suite 330
* Boston, MA 02111-1307 USA
*
* @author Scott Ferguson
*/
package com.caucho.ejb.cfg;
import com.caucho.config.ConfigException;
import com.caucho.config.types.DescriptionGroupConfig;
import com.caucho.config.types.Signature;
import com.caucho.util.L10N;
import com.caucho.vfs.Path;
import java.util.*;
import javax.annotation.PostConstruct;
/**
* Configuration for an ejb bean.
*/
public class EjbJar extends DescriptionGroupConfig {
private static final L10N L = new L10N(EjbJar.class);
private final EjbConfig _config;
private String _ejbModuleName;
private Path _rootPath;<|fim▁hole|> private boolean _isSkip;
public EjbJar(EjbConfig config,
String ejbModuleName,
Path rootPath)
{
_config = config;
_ejbModuleName = ejbModuleName;
_rootPath = rootPath;
}
public String getModuleName()
{
return _ejbModuleName;
}
public void setModuleName(String moduleName)
{
_ejbModuleName = moduleName;
}
public void setVersion(String version)
{
}
public void setSchemaLocation(String value)
{
}
public void setSkip(boolean isSkip)
{
_isSkip = isSkip;
}
public boolean isSkip()
{
return _isSkip;
}
public void setMetadataComplete(boolean isMetadataComplete)
{
_isMetadataComplete = isMetadataComplete;
}
public boolean isMetadataComplete()
{
return _isMetadataComplete;
}
public EjbEnterpriseBeans createEnterpriseBeans()
throws ConfigException
{
return new EjbEnterpriseBeans(_config, this, _ejbModuleName);
}
public InterceptorsConfig createInterceptors()
throws ConfigException
{
return new InterceptorsConfig(_config);
}
public Relationships createRelationships()
throws ConfigException
{
return new Relationships(_config);
}
public AssemblyDescriptor createAssemblyDescriptor()
throws ConfigException
{
return new AssemblyDescriptor(this, _config);
}
public void addQueryFunction(QueryFunction fun)
{
}
public void setBooleanLiteral(BooleanLiteral literal)
{
}
ContainerTransaction createContainerTransaction()
{
return new ContainerTransaction(this, _config);
}
MethodPermission createMethodPermission()
{
return new MethodPermission(_config);
}
public String toString()
{
return getClass().getSimpleName() + "[" + _rootPath.getFullPath() + "]";
}
public class MethodPermission {
EjbConfig _config;
MethodSignature _method;
ArrayList<String> _roles;
MethodPermission(EjbConfig config)
{
_config = config;
}
public void setDescription(String description)
{
}
public void setUnchecked(boolean unchecked)
{
}
public void setRoleName(String roleName)
{
if (_roles == null)
_roles = new ArrayList<String>();
_roles.add(roleName);
}
public void setMethod(MethodSignature method)
{
_method = method;
}
@PostConstruct
public void init()
throws ConfigException
{
if (isSkip())
return;
EjbBean bean = _config.getBeanConfig(_method.getEJBName());
if (bean == null)
throw new ConfigException(L.l("'{0}' is an unknown bean.",
_method.getEJBName()));
EjbMethodPattern method = bean.createMethod(_method);
if (_roles != null)
method.setRoles(_roles);
}
}
public static class QueryFunction {
FunctionSignature _sig;
String _sql;
public void setSignature(Signature sig)
throws ConfigException
{
_sig = new FunctionSignature(sig.getSignature());
}
public FunctionSignature getSignature()
{
return _sig;
}
public void setSQL(String sql)
throws ConfigException
{
_sql = sql;
}
public String getSQL()
{
return _sql;
}
@PostConstruct
public void init()
{
_sig.setSQL(_sql);
}
}
public static class Relationships {
EjbConfig _config;
Relationships(EjbConfig config)
{
_config = config;
}
}
}<|fim▁end|> |
private boolean _isMetadataComplete; |
<|file_name|>test_sign.rs<|end_file_name|><|fim▁begin|>use eval::eval;
use eval::test_eval::test_eval;
use eval::eval::Printable;
#[test]
fn test_eval_basic_sign() {
test_eval(~"×5", |result| {
match result {
~eval::AplInteger(x) => {
assert_eq!(x, 1);
},
_ => {
fail!(format!("Didn't find a number - {}", result.to_typed_string()));
}
}
});
test_eval(~"×0", |result| {
match result {
~eval::AplInteger(x) => {
assert_eq!(x, 0);
},
_ => {
fail!(format!("Didn't find a number - {}", result.to_typed_string()));
}
}
});<|fim▁hole|> assert_eq!(x, -1);
},
_ => {
fail!(format!("Didn't find a number - {}", result.to_typed_string()));
}
}
});
test_eval(~"×1J1", |result| {
match result {
~eval::AplComplex(c) => {
assert_approx_eq!(c.re, 0.707107);
assert_approx_eq!(c.im, 0.707107);
},
_ => {
fail!(format!("Didn't find a number - {}", result.to_typed_string()));
}
}
});
}
#[test]
fn test_eval_array_sign() {
test_eval(~"×0.5 ¯1 1", |result| {
match result {
~eval::AplArray(ref _order, ref _dims, ref array) => {
match (&array[0], &array[1]) {
(&~eval::AplInteger(1), &~eval::AplInteger(-1)) => {
},
_ => {
fail!(~"Bad array sign")
}
}
},
_ => {
fail!(format!("Didn't find a number - {}", result.to_typed_string()));
}
}
});
}<|fim▁end|> |
test_eval(~"ׯ5", |result| {
match result {
~eval::AplInteger(x) => { |
<|file_name|>test_CommentMarker.py<|end_file_name|><|fim▁begin|>from __future__ import print_function
import aaf
import aaf.mob
import aaf.define
import aaf.iterator
import aaf.dictionary
import aaf.storage
import aaf.component
import aaf.util
from aaf.util import AUID, MobID
import unittest
import os
cur_dir = os.path.dirname(os.path.abspath(__file__))
sandbox = os.path.join(cur_dir,'sandbox')
if not os.path.exists(sandbox):
os.makedirs(sandbox)
class TestCommentMaker(unittest.TestCase):
def test_add_comment_marker_props(self):
f = aaf.open()
# add RGBColor TypeDef
rgb_id = AUID("urn:uuid:e96e6d43-c383-11d3-a069-006094eb75cb")
rgb_typedef_pairs = [('red', 'UInt16'),
('green', 'UInt16'),
("blue", 'UInt16'),
]
rgb_typdef = aaf.define.TypeDefRecord(f, rgb_typedef_pairs, rgb_id, 'RGBColor')
f.dictionary.register_def(rgb_typdef)
cm_classdef = f.dictionary.lookup_classdef("CommentMarker")
string_typedef = f.dictionary.lookup_typedef("string")
# add CommentMarkerTime property
cm_time_id = AUID("urn:uuid:c4c45d9c-0967-11d4-a08a-006094eb75cb")
cm_prop_name = "CommentMarkerTime"
cm_classdef.register_optional_propertydef(string_typedef, cm_time_id, cm_prop_name)
# add CommentMarkerDate property
cm_date_id = AUID("urn:uuid:c4c45d9b-0967-11d4-a08a-006094eb75cb")
cm_prop_name = "CommentMarkerDate"
cm_classdef.register_optional_propertydef(string_typedef, cm_date_id, cm_prop_name)
# add CommentMarkerUSer property
cm_user_id = AUID("urn:uuid:c4c45d9a-0967-11d4-a08a-006094eb75cb")
cm_prop_name = "CommentMarkerUSer"
cm_classdef.register_optional_propertydef(string_typedef, cm_user_id, cm_prop_name)
# add CommentMarkerColor property
cm_color_id = AUID("urn:uuid:e96e6d44-c383-11d3-a069-006094eb75cb")
cm_prop_name = "CommentMarkerColor"
cm_classdef.register_optional_propertydef(rgb_typdef, cm_color_id, cm_prop_name)
# add CommentMarkerAttributeList property<|fim▁hole|> cm_classdef.register_optional_propertydef(strongref, cm_attr_list_id, cm_prop_name)
marker = f.create.DescriptiveMarker()
marker['CommentMarkerTime'].value = "22:40"
marker['CommentMarkerDate'].value = "06/18/2016"
marker['CommentMarkerUSer'].value = "USERNAME"
marker_colors = {"red":41471, "green":12134, "blue":6564}
marker["CommentMarkerColor"].value = marker_colors
int32_typedef = f.dictionary.lookup_typedef("Int32")
crm_id = "060a2b340101010101010f0013-000000-5766066e2cd404e5-060e2b347f7f-2a80"
crm_com = "This is the first marker text"
attr_data = [('_ATN_CRM_LONG_CREATE_DATE', 1466304031, int32_typedef ),
('_ATN_CRM_USER', "USERNAME", string_typedef),
('_ATN_CRM_DATE', "06/18/2016", string_typedef),
('_ATN_CRM_TIME', "22:40", string_typedef),
('_ATN_CRM_COLOR', "Red", string_typedef),
('_ATN_CRM_COM', crm_com, string_typedef),
('_ATN_CRM_LONG_MOD_DATE', 1466304042, int32_typedef ),
('_ATN_CRM_ID', crm_id, string_typedef),
]
tagged_values = [f.create.TaggedValue(name, value, typedef) for name, value,typedef in attr_data]
marker["CommentMarkerAttributeList"].value = tagged_values
for i,tag in enumerate(marker["CommentMarkerAttributeList"].value):
self.assertEqual(tag.name, attr_data[i][0])
self.assertEqual(tag.value, attr_data[i][1])
self.assertEqual(tag.typedef(), attr_data[i][2])
self.assertEqual(marker["CommentMarkerColor"].value, marker_colors)
self.assertEqual(marker['CommentMarkerUSer'].value, "USERNAME")
if __name__ == "__main__":
unittest.main()<|fim▁end|> | cm_attr_list_id = AUID("urn:uuid:c72cc817-aac5-499b-af34-bc47fec1eaa8")
strongref = f.dictionary.lookup_typedef("TaggedValueStrongReferenceVector")
cm_prop_name = "CommentMarkerAttributeList" |
<|file_name|>Menu_Utama.java<|end_file_name|><|fim▁begin|>package remasterkit;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import javax.swing.JLabel;
import javax.swing.ImageIcon;
import javax.swing.border.TitledBorder;
import javax.swing.border.LineBorder;
import java.awt.Color;
import java.awt.Toolkit;
import javax.swing.JButton;
import java.awt.Font;
import javax.swing.JCheckBox;
import com.jtattoo.plaf.graphite.GraphiteLookAndFeel;
import javax.swing.JComboBox;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JTextField;
public class Menu_Utama extends JFrame {
private JPanel contentPane;<|fim▁hole|> * Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
UIManager.setLookAndFeel(new GraphiteLookAndFeel());
Menu_Utama frame = new Menu_Utama();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Menu_Utama() {
setIconImage(Toolkit.getDefaultToolkit().getImage("/home/newbieilmu/workspace/app.remasterkit/src/icon/logo.png"));
setTitle("RemasterKit(Custom Linuxmu Sesuka Hati)");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 589, 357);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JPanel panelRKit = new JPanel();
panelRKit.setBorder(new TitledBorder(null, "RemasterKit", TitledBorder.LEADING, TitledBorder.TOP, null, null));
panelRKit.setBounds(146, 12, 421, 163);
contentPane.add(panelRKit);
panelRKit.setLayout(null);
JLabel lblPilihDe = new JLabel("1. Pilih DE ");
lblPilihDe.setBounds(12, 27, 105, 18);
panelRKit.add(lblPilihDe);
JComboBox cmbDE = new JComboBox();
cmbDE.setModel(new DefaultComboBoxModel(new String[] {"LXDE", "MATE", "GNOME", "KDE", "Manokwari"}));
cmbDE.setBounds(110, 24, 89, 24);
panelRKit.add(cmbDE);
JLabel lblUbahSourcelist = new JLabel("2. Source.List");
lblUbahSourcelist.setBounds(12, 57, 105, 18);
panelRKit.add(lblUbahSourcelist);
JLabel lblPilihConsole = new JLabel("3. Console ");
lblPilihConsole.setBounds(12, 87, 105, 18);
panelRKit.add(lblPilihConsole);
JLabel lblInstallDeb = new JLabel("4. Install DEB");
lblInstallDeb.setBounds(12, 117, 105, 18);
panelRKit.add(lblInstallDeb);
JLabel lblPaketList = new JLabel("5. Paket List ");
lblPaketList.setBounds(217, 27, 105, 18);
panelRKit.add(lblPaketList);
JLabel lblSynaptic = new JLabel("6. Synaptic ");
lblSynaptic.setBounds(217, 58, 105, 18);
panelRKit.add(lblSynaptic);
JLabel lblDesktop = new JLabel("7. Desktop");
lblDesktop.setBounds(217, 88, 105, 18);
panelRKit.add(lblDesktop);
JLabel lblUbiquity = new JLabel("8. Ubiquity");
lblUbiquity.setBounds(217, 120, 105, 18);
panelRKit.add(lblUbiquity);
JButton btnSource = new JButton("Source.list");
btnSource.setEnabled(false);
btnSource.setBounds(110, 54, 86, 24);
panelRKit.add(btnSource);
JButton btnConsole = new JButton("Console");
btnConsole.setEnabled(false);
btnConsole.setBounds(110, 84, 86, 24);
panelRKit.add(btnConsole);
JButton btnDeb = new JButton("DEB");
btnDeb.setEnabled(false);
btnDeb.setBounds(110, 114, 86, 24);
panelRKit.add(btnDeb);
JButton btnPaketList = new JButton("Paket list");
btnPaketList.setEnabled(false);
btnPaketList.setBounds(309, 24, 86, 24);
panelRKit.add(btnPaketList);
JButton btnSynaptic = new JButton("Synaptic");
btnSynaptic.setEnabled(false);
btnSynaptic.setBounds(309, 55, 86, 24);
panelRKit.add(btnSynaptic);
JButton btnDekstop = new JButton("Dekstop");
btnDekstop.setEnabled(false);
btnDekstop.setBounds(309, 87, 86, 24);
panelRKit.add(btnDekstop);
JButton btnUbiquity = new JButton("Ubiquity");
btnUbiquity.setEnabled(false);
btnUbiquity.setBounds(309, 117, 86, 24);
panelRKit.add(btnUbiquity);
JButton btnAbout = new JButton("Tentang");
btnAbout.setBounds(299, 280, 86, 31);
contentPane.add(btnAbout);
JButton btnCredits = new JButton("Kredits");
btnCredits.setBounds(389, 280, 86, 31);
contentPane.add(btnCredits);
JButton btnLisensi = new JButton("Lisensi");
btnLisensi.setBounds(481, 280, 86, 31);
contentPane.add(btnLisensi);
JLabel lblIcon1 = new JLabel("");
lblIcon1.setIcon(new ImageIcon("/home/newbieilmu/workspace/app.remasterkit/src/icon/1374533657__settings.png"));
lblIcon1.setBounds(12, 12, 55, 67);
contentPane.add(lblIcon1);
JLabel lblicon2 = new JLabel("");
lblicon2.setIcon(new ImageIcon("/home/newbieilmu/workspace/app.remasterkit/src/icon/1374533644_Import.png"));
lblicon2.setBounds(12, 72, 55, 67);
contentPane.add(lblicon2);
JLabel lblicon3 = new JLabel("");
lblicon3.setIcon(new ImageIcon("/home/newbieilmu/workspace/app.remasterkit/src/icon/1374533631_Export.png"));
lblicon3.setBounds(12, 137, 55, 67);
contentPane.add(lblicon3);
JLabel lblicon4 = new JLabel("");
lblicon4.setIcon(new ImageIcon("/home/newbieilmu/workspace/app.remasterkit/src/icon/1374534090_118.png"));
lblicon4.setBounds(12, 202, 55, 67);
contentPane.add(lblicon4);
JLabel lblKonfigurasi = new JLabel("Konfigurasi");
lblKonfigurasi.setFont(new Font("Dialog", Font.BOLD, 13));
lblKonfigurasi.setBounds(67, 35, 86, 18);
contentPane.add(lblKonfigurasi);
JLabel lblImport = new JLabel("Import");
lblImport.setFont(new Font("Dialog", Font.BOLD, 13));
lblImport.setBounds(67, 91, 86, 18);
contentPane.add(lblImport);
JLabel lblEksport = new JLabel("Eksport");
lblEksport.setFont(new Font("Dialog", Font.BOLD, 13));
lblEksport.setBounds(67, 151, 86, 18);
contentPane.add(lblEksport);
JLabel lblBuild = new JLabel("Build");
lblBuild.setFont(new Font("Dialog", Font.BOLD, 13));
lblBuild.setBounds(67, 216, 86, 18);
contentPane.add(lblBuild);
JPanel panelSetting = new JPanel();
panelSetting.setBorder(new TitledBorder(null, "Setting ", TitledBorder.LEADING, TitledBorder.TOP, null, null));
panelSetting.setBounds(146, 181, 421, 88);
contentPane.add(panelSetting);
panelSetting.setLayout(null);
JLabel lblNamaLinuxmu = new JLabel("Nama Linuxmu :");
lblNamaLinuxmu.setBounds(12, 24, 92, 18);
panelSetting.add(lblNamaLinuxmu);
txtName = new JTextField();
txtName.setColumns(10);
txtName.setBounds(122, 22, 179, 22);
panelSetting.add(txtName);
JLabel lblUrl = new JLabel("URL :");
lblUrl.setBounds(12, 54, 92, 18);
panelSetting.add(lblUrl);
txtURL = new JTextField();
txtURL.setColumns(10);
txtURL.setBounds(122, 52, 179, 22);
panelSetting.add(txtURL);
JButton btnDonasi = new JButton("Donasi");
btnDonasi.setBounds(207, 280, 86, 31);
contentPane.add(btnDonasi);
}
}<|fim▁end|> | private JTextField txtName;
private JTextField txtURL;
/** |
<|file_name|>show.js<|end_file_name|><|fim▁begin|>var SuperheroesShowRoute = Ember.Route.extend({
model: function(params) {
return(this.store.find('superhero', params.id));
}<|fim▁hole|><|fim▁end|> | });
export default SuperheroesShowRoute; |
<|file_name|>analemma.py<|end_file_name|><|fim▁begin|>"""Solar analemma."""
from ._skyBase import RadianceSky
from ..material.light import Light
from ..geometry.source import Source
from ladybug.epw import EPW
from ladybug.sunpath import Sunpath
import os
try:
from itertools import izip as zip
writemode = 'wb'
except ImportError:
# python 3
writemode = 'w'
class Analemma(RadianceSky):
"""Generate a radiance-based analemma.
Use Analemma for solar access/sunlight hours studies. For annual daylight/radiation
studies see AnalemmaReversed.
Analemma consists of two files:
1. *.ann file which includes sun geometries and materials.
2. *.mod file includes list of modifiers that are included in *.ann file.
"""
def __init__(self, sun_vectors, sun_up_hours):
"""Radiance-based analemma.
Args:
sun_vectors: A list of sun vectors as (x, y, z).
sun_up_hours: List of hours of the year that corresponds to sun_vectors.
"""
RadianceSky.__init__(self)
vectors = sun_vectors or []
# reverse sun vectors
self._sun_vectors = tuple(tuple(v) for v in vectors)
self._sun_up_hours = sun_up_hours
assert len(sun_up_hours) == len(vectors), \
ValueError(
'Length of vectors [%d] does not match the length of hours [%d]' %
(len(vectors), len(sun_up_hours))
)
@classmethod
def from_json(cls, inp):
"""Create an analemma from a dictionary."""
return cls(inp['sun_vectors'], inp['sun_up_hours'])
@classmethod
def from_location(cls, location, hoys=None, north=0, is_leap_year=False):
"""Generate a radiance-based analemma for a location.
Args:
location: A ladybug location.
hoys: A list of hours of the year (default: range(8760)).
north: North angle from Y direction (default: 0).
is_leap_year: A boolean to indicate if hours are for a leap year
(default: False).
"""
sun_vectors = []
sun_up_hours = []
hoys = hoys or range(8760)
north = north or 0
sp = Sunpath.from_location(location, north)
sp.is_leap_year = is_leap_year
for hour in hoys:
sun = sp.calculate_sun_from_hoy(hour)
if sun.altitude < 0:
continue
sun_vectors.append(sun.sun_vector)
sun_up_hours.append(hour)
return cls(sun_vectors, sun_up_hours)
@classmethod
def from_location_sun_up_hours(cls, location, sun_up_hours, north=0,
is_leap_year=False):
"""Generate a radiance-based analemma for a location.
Args:
location: A ladybug location.
sun_up_hours: A list of hours of the year to be included in analemma.
north: North angle from Y direction (default: 0).
is_leap_year: A boolean to indicate if hours are for a leap year
(default: False).
"""
sun_vectors = []
north = north or 0
sp = Sunpath.from_location(location, north)
sp.is_leap_year = is_leap_year
for hour in sun_up_hours:
sun = sp.calculate_sun_from_hoy(hour)
sun_vectors.append(sun.sun_vector)
return cls(sun_vectors, sun_up_hours)
@classmethod
def from_wea(cls, wea, hoys=None, north=0, is_leap_year=False):
"""Generate a radiance-based analemma from a ladybug wea.
NOTE: Only the location from wea will be used for creating analemma. For
climate-based sun materix see SunMatrix class.
Args:
wea: A ladybug Wea.
sun_up_hours: A list of hours of the year to be included in analemma.
north: North angle from Y direction (default: 0).
is_leap_year: A boolean to indicate if hours are for a leap year
(default: False).
"""
return cls.from_location(wea.location, hoys, north, is_leap_year)
@classmethod
def from_wea_sun_up_hours(cls, wea, sun_up_hours, north=0, is_leap_year=False):
"""Generate a radiance-based analemma from a ladybug wea.
NOTE: Only the location from wea will be used for creating analemma. For
climate-based sun materix see SunMatrix class.
Args:
wea: A ladybug Wea.
sun_up_hours: A list of hours of the year to be included in analemma.
north: North angle from Y direction (default: 0).
is_leap_year: A boolean to indicate if hours are for a leap year
(default: False).
"""
return cls.from_location_sun_up_hours(wea.location, sun_up_hours, north,
is_leap_year)
@classmethod
def from_epw_file(cls, epw_file, hoys=None, north=0, is_leap_year=False):
"""Create sun matrix from an epw file.
NOTE: Only the location from epw file will be used for creating analemma. For
climate-based sun materix see SunMatrix class.<|fim▁hole|> north: North angle from Y direction (default: 0).
is_leap_year: A boolean to indicate if hours are for a leap year
(default: False).
"""
return cls.from_location(EPW(epw_file).location, hoys, north, is_leap_year)
@classmethod
def from_epw_file_sun_up_hours(cls, epw_file, sun_up_hours, north=0,
is_leap_year=False):
"""Create sun matrix from an epw file.
NOTE: Only the location from epw file will be used for creating analemma. For
climate-based sun materix see SunMatrix class.
Args:
epw_file: Full path to an epw file.
sun_up_hours: A list of hours of the year to be included in analemma.
north: North angle from Y direction (default: 0).
is_leap_year: A boolean to indicate if hours are for a leap year
(default: False).
"""
return cls.from_location_sun_up_hours(EPW(epw_file).location, sun_up_hours,
north, is_leap_year)
@property
def isAnalemma(self):
"""Return True."""
return True
@property
def is_climate_based(self):
"""Return True if generated based on values from weather file."""
return False
@property
def analemma_file(self):
"""Analemma file name.
Use this file to create the octree.
"""
return 'analemma.rad'
@property
def sunlist_file(self):
"""Sun list file name.
Use this file as the list of modifiers in rcontrib.
"""
return 'analemma.mod'
@property
def sun_vectors(self):
"""Return list of sun vectors."""
return self._sun_vectors
@property
def sun_up_hours(self):
"""Return list of hours for sun vectors."""
return self._sun_up_hours
def execute(self, working_dir):
fp = os.path.join(working_dir, self.analemma_file) # analemma file (geo and mat)
sfp = os.path.join(working_dir, self.sunlist_file) # modifier list
with open(fp, writemode) as outf, open(sfp, writemode) as outm:
for hoy, vector in zip(self.sun_up_hours, self.sun_vectors):
# use minute of the year to name sun positions
moy = int(round(hoy * 60))
mat = Light('sol_%06d' % moy, 1e6, 1e6, 1e6)
sun = Source('sun_%06d' % moy, vector, 0.533, mat)
outf.write(sun.to_rad_string(True).replace('\n', ' ') + '\n')
outm.write('sol_%06d\n' % moy)
def duplicate(self):
"""Duplicate this class."""
return Analemma(self.sun_vectors, self.sun_up_hours)
def to_rad_string(self):
"""Get the radiance command line as a string."""
raise AttributeError(
'analemma does not have a single line command. Try execute method.'
)
def to_json(self):
"""Convert analemma to a dictionary."""
return {'sun_vectors': self.sun_vectors, 'sun_up_hours': self.sun_up_hours}
def ToString(self):
"""Overwrite .NET ToString method."""
return self.__repr__()
def __repr__(self):
"""Analemma representation."""
return 'Analemma: #%d' % len(self.sun_vectors)
class AnalemmaReversed(Analemma):
"""Generate a radiance-based analemma.
Reversed Analemma reverses direction of input sun vectors. Use reversed Analemma for
radiation and daylight studies.
Analemma consists of two files:
1. *_reversed.ann file which includes sun geometries and materials.
2. *.mod file includes list of modifiers that are included in
*_reversed.ann file.
"""
@property
def analemma_file(self):
"""Analemma file name.
Use this file to create the octree.
"""
return 'analemma_reversed.rad'
def execute(self, working_dir):
fp = os.path.join(working_dir, self.analemma_file) # analemma file (geo and mat)
sfp = os.path.join(working_dir, self.sunlist_file) # modifier list
with open(fp, writemode) as outf, open(sfp, writemode) as outm:
for hoy, vector in zip(self.sun_up_hours, self.sun_vectors):
# use minute of the year to name sun positions
moy = int(round(hoy * 60))
# reverse sun vector
r_vector = tuple(-1 * i for i in vector)
mat = Light('sol_%06d' % moy, 1e6, 1e6, 1e6)
sun = Source('sun_%06d' % moy, r_vector, 0.533, mat)
outf.write(sun.to_rad_string(True).replace('\n', ' ') + '\n')
outm.write('sol_%06d\n' % moy)<|fim▁end|> |
Args:
epw_file: Full path to an epw file.
hoys: A list of hours of the year (default: range(8760)). |
<|file_name|>cargo_expand.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use crate::bindgen::config::Profile;
use std::env;
use std::error;
use std::fmt;
use std::io;
use std::path::{Path, PathBuf};
use std::process::Command;
use std::str::{from_utf8, Utf8Error};
extern crate tempfile;
use self::tempfile::Builder;
#[derive(Debug)]
/// Possible errors that can occur during `rustc -Zunpretty=expanded`.
pub enum Error {
/// Error during creation of temporary directory
Io(io::Error),
/// Output of `cargo metadata` was not valid utf8
Utf8(Utf8Error),
/// Error during execution of `cargo rustc -Zunpretty=expanded`
Compile(String),
}
impl From<io::Error> for Error {
fn from(err: io::Error) -> Self {
Error::Io(err)
}
}
impl From<Utf8Error> for Error {
fn from(err: Utf8Error) -> Self {
Error::Utf8(err)
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Error::Io(ref err) => err.fmt(f),
Error::Utf8(ref err) => err.fmt(f),
Error::Compile(ref err) => write!(f, "{}", err),
}
}
}
impl error::Error for Error {
fn source(&self) -> Option<&(dyn error::Error + 'static)> {
match self {
Error::Io(ref err) => Some(err),
Error::Utf8(ref err) => Some(err),
Error::Compile(..) => None,
}
}
}
/// Use rustc to expand and pretty print the crate into a single file,
/// removing any macros in the process.
#[allow(clippy::too_many_arguments)]
pub fn expand(
manifest_path: &Path,
crate_name: &str,
version: Option<&str>,
use_tempdir: bool,
expand_all_features: bool,
expand_default_features: bool,
expand_features: &Option<Vec<String>>,
profile: Profile,
) -> Result<String, Error> {
let cargo = env::var("CARGO").unwrap_or_else(|_| String::from("cargo"));
let mut cmd = Command::new(cargo);
let mut _temp_dir = None; // drop guard<|fim▁hole|> cmd.env("CARGO_TARGET_DIR", path);
} else if let Ok(ref path) = env::var("OUT_DIR") {
// When cbindgen was started programatically from a build.rs file, Cargo is running and
// locking the default target directory. In this case we need to use another directory,
// else we would end up in a deadlock. If Cargo is running `OUT_DIR` will be set, so we
// can use a directory relative to that.
cmd.env("CARGO_TARGET_DIR", PathBuf::from(path).join("expanded"));
}
// Set this variable so that we don't call it recursively if we expand a crate that is using
// cbindgen
cmd.env("_CBINDGEN_IS_RUNNING", "1");
cmd.arg("rustc");
cmd.arg("--lib");
// When build with the release profile we can't choose the `check` profile.
if profile != Profile::Release {
cmd.arg("--profile=check");
}
cmd.arg("--manifest-path");
cmd.arg(manifest_path);
if let Some(features) = expand_features {
cmd.arg("--features");
let mut features_str = String::new();
for (index, feature) in features.iter().enumerate() {
if index != 0 {
features_str.push(' ');
}
features_str.push_str(feature);
}
cmd.arg(features_str);
}
if expand_all_features {
cmd.arg("--all-features");
}
if !expand_default_features {
cmd.arg("--no-default-features");
}
match profile {
Profile::Debug => {}
Profile::Release => {
cmd.arg("--release");
}
}
cmd.arg("-p");
let mut package = crate_name.to_owned();
if let Some(version) = version {
package.push(':');
package.push_str(version);
}
cmd.arg(&package);
cmd.arg("--verbose");
cmd.arg("--");
cmd.arg("-Zunpretty=expanded");
info!("Command: {:?}", cmd);
let output = cmd.output()?;
let src = from_utf8(&output.stdout)?.to_owned();
let error = from_utf8(&output.stderr)?.to_owned();
if src.is_empty() {
Err(Error::Compile(error))
} else {
Ok(src)
}
}<|fim▁end|> | if use_tempdir {
_temp_dir = Some(Builder::new().prefix("cbindgen-expand").tempdir()?);
cmd.env("CARGO_TARGET_DIR", _temp_dir.unwrap().path());
} else if let Ok(ref path) = env::var("CARGO_EXPAND_TARGET_DIR") { |
<|file_name|>gtk_builder.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# tests/client/gtk_builder_lint.py
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of the project nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
import unittest
import xml.etree.ElementTree as ElementTree
from king_phisher import find<|fim▁hole|>
GOBJECT_TOP_REGEX = r'^[A-Z][a-zA-Z0-9]+$'
class ClientGtkBuilderLint(testing.KingPhisherTestCase):
def setUp(self):
find.data_path_append('data/client')
builder_xml = find.data_file('king-phisher-client.ui')
self.xml_tree = ElementTree.parse(builder_xml)
self.xml_root = self.xml_tree.getroot()
def test_object_ids_are_valid(self):
for child in self.xml_root:
if child.tag != 'object':
continue
gobject_id = child.attrib['id']
self.assertRegex(gobject_id, GOBJECT_TOP_REGEX, "invalid gobject id '{0}'".format(gobject_id))
if __name__ == '__main__':
unittest.main()<|fim▁end|> | from king_phisher import testing |
<|file_name|>multithreads.py<|end_file_name|><|fim▁begin|>"""
Allow to trace called methods and package
"""
import frida
import re
syms = []
def on_message(message, data):
global syms
global index, filename
if message['type'] == 'send':
if "SYM" in message["payload"]:
c = message["payload"].split(":")[1]
print c
syms.append(c)
else:
print("[*] {0}".format(message["payload"]))
else:
print(message)
def overload2params(x):
start = 97
params = []
count_re = re.compile('\((.*)\)')
arguments = count_re.findall(x)
if arguments[0]:
arguments = arguments[0]
arguments = arguments.replace(" ", "")
arguments = arguments.split(",")
for _ in arguments:
params.append(chr(start))
start += 1
return ",".join(params)
else:
return ""
def get_script():
jscode = """
Java.perform(function() {
var flagArray = [];
var randomfile = Java.use('java.io.RandomAccessFile');
var skip = true;
randomfile.seek.implementation = function(pos)
{
if (pos == 0){
skip = false;
}
return randomfile.seek.call(this, pos);
}
randomfile.writeChar.implementation = function(c)
{
if(skip || c == 10)
{
send("PARTIAL:"+flagArray.join(""));
}else{
send("index: "+c);
flagArray.push(String.fromCharCode(c))
send("SYM:"+String.fromCharCode(c));
}
return randomfile.writeChar.call(this, c);
}
});
"""
return jscode
def attach_to_process(proc_name):
done = False
process = None
while not done:
try:
process = frida.get_usb_device().attach(proc_name)
done = True
except Exception:
pass
return process
if __name__ == "__main__":
print "[+] Waiting for app called {0}".format("hackchallenge.ahe17.teamsik.org.romanempire")
process = attach_to_process("hackchallenge.ahe17.teamsik.org.romanempire")
script = get_script()
try:
script = process.create_script(script)
except frida.InvalidArgumentError as e:
message = e.args[0]
line = re.compile('Script\(line (\d+)\)')
line = int(line.findall(message)[0])
script = script.split("\n")
print "[-] Error on line {0}:\n{1}: {2}".format(line, line, script[line])
exit(0)
script.on('message', on_message)
print('[*] Attached on process')
print('[*] Press enter to exit...')
script.load()
try:
raw_input()
except KeyboardInterrupt:
pass
<|fim▁hole|><|fim▁end|> | print "FLAG: " + "".join(syms) |
<|file_name|>0007_auto_20160710_1833.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-07-10 18:33
from __future__ import unicode_literals<|fim▁hole|>class Migration(migrations.Migration):
dependencies = [
('main', '0006_auto_20160616_1640'),
]
operations = [
migrations.AlterField(
model_name='episode',
name='edit_key',
field=models.CharField(blank=True, default='41086227', help_text='key to allow unauthenticated users to edit this item.', max_length=32, null=True),
),
]<|fim▁end|> |
from django.db import migrations, models
|
<|file_name|>test_abs.py<|end_file_name|><|fim▁begin|>from .. utils import TranspileTestCase, BuiltinFunctionTestCase
class AbsTests(TranspileTestCase):
def test_abs_not_implemented(self):
self.assertCodeExecution("""
class NotAbsLike:
pass
x = NotAbsLike()
try:
print(abs(x))
except TypeError as err:
print(err)
""")
class BuiltinAbsFunctionTests(BuiltinFunctionTestCase, TranspileTestCase):
functions = ["abs"]
not_implemented = [
'test_class',<|fim▁hole|> ]<|fim▁end|> | 'test_frozenset', |
<|file_name|>char_recognition_tasks.py<|end_file_name|><|fim▁begin|># Copyright 2021, The TensorFlow Federated Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Library for creating character recognition tasks on EMNIST."""
import enum
from typing import Optional, Union
import tensorflow as tf
from tensorflow_federated.python.learning import keras_utils
from tensorflow_federated.python.learning import model
from tensorflow_federated.python.simulation.baselines import baseline_task
from tensorflow_federated.python.simulation.baselines import client_spec
from tensorflow_federated.python.simulation.baselines import task_data
from tensorflow_federated.python.simulation.baselines.emnist import emnist_models
from tensorflow_federated.python.simulation.baselines.emnist import emnist_preprocessing
from tensorflow_federated.python.simulation.datasets import client_data
from tensorflow_federated.python.simulation.datasets import emnist
class CharacterRecognitionModel(enum.Enum):
"""Enum for EMNIST character recognition models."""
CNN_DROPOUT = 'cnn_dropout'
CNN = 'cnn'
TWO_LAYER_DNN = '2nn'
_CHARACTER_RECOGNITION_MODELS = [e.value for e in CharacterRecognitionModel]
def _get_character_recognition_model(model_id: Union[str,
CharacterRecognitionModel],
only_digits: bool) -> tf.keras.Model:
"""Constructs a `tf.keras.Model` for character recognition."""
try:
model_enum = CharacterRecognitionModel(model_id)
except ValueError:
raise ValueError('The model argument must be one of {}, found {}'.format(
_CHARACTER_RECOGNITION_MODELS, model_id))
if model_enum == CharacterRecognitionModel.CNN_DROPOUT:
keras_model = emnist_models.create_conv_dropout_model(
only_digits=only_digits)
elif model_enum == CharacterRecognitionModel.CNN:
keras_model = emnist_models.create_original_fedavg_cnn_model(
only_digits=only_digits)
elif model_enum == CharacterRecognitionModel.TWO_LAYER_DNN:
keras_model = emnist_models.create_two_hidden_layer_model(
only_digits=only_digits)
else:
raise ValueError('The model id must be one of {}, found {}'.format(
_CHARACTER_RECOGNITION_MODELS, model_id))
return keras_model
def create_character_recognition_task_from_datasets(
train_client_spec: client_spec.ClientSpec,
eval_client_spec: Optional[client_spec.ClientSpec],
model_id: Union[str, CharacterRecognitionModel], only_digits: bool,
train_data: client_data.ClientData,
test_data: client_data.ClientData) -> baseline_task.BaselineTask:
"""Creates a baseline task for character recognition on EMNIST.
Args:
train_client_spec: A `tff.simulation.baselines.ClientSpec` specifying how to
preprocess train client data.
eval_client_spec: An optional `tff.simulation.baselines.ClientSpec`
specifying how to preprocess evaluation client data. If set to `None`, the
evaluation datasets will use a batch size of 64 with no extra
preprocessing.
model_id: A string identifier for a character recognition model. Must be one
of 'cnn_dropout', 'cnn', or '2nn'. These correspond respectively to a CNN
model with dropout, a CNN model with no dropout, and a densely connected
network with two hidden layers of width 200.
only_digits: A boolean indicating whether to use the full EMNIST-62 dataset
containing 62 alphanumeric classes (`True`) or the smaller EMNIST-10
dataset with only 10 numeric classes (`False`).
train_data: A `tff.simulation.datasets.ClientData` used for training.
test_data: A `tff.simulation.datasets.ClientData` used for testing.
Returns:
A `tff.simulation.baselines.BaselineTask`.
"""
emnist_task = 'character_recognition'
if eval_client_spec is None:
eval_client_spec = client_spec.ClientSpec(
num_epochs=1, batch_size=64, shuffle_buffer_size=1)<|fim▁hole|> train_client_spec, emnist_task=emnist_task)
eval_preprocess_fn = emnist_preprocessing.create_preprocess_fn(
eval_client_spec, emnist_task=emnist_task)
task_datasets = task_data.BaselineTaskDatasets(
train_data=train_data,
test_data=test_data,
validation_data=None,
train_preprocess_fn=train_preprocess_fn,
eval_preprocess_fn=eval_preprocess_fn)
def model_fn() -> model.Model:
return keras_utils.from_keras_model(
keras_model=_get_character_recognition_model(model_id, only_digits),
loss=tf.keras.losses.SparseCategoricalCrossentropy(),
input_spec=task_datasets.element_type_structure,
metrics=[tf.keras.metrics.SparseCategoricalAccuracy()])
return baseline_task.BaselineTask(task_datasets, model_fn)
def create_character_recognition_task(
train_client_spec: client_spec.ClientSpec,
eval_client_spec: Optional[client_spec.ClientSpec] = None,
model_id: Union[str, CharacterRecognitionModel] = 'cnn_dropout',
only_digits: bool = False,
cache_dir: Optional[str] = None,
use_synthetic_data: bool = False) -> baseline_task.BaselineTask:
"""Creates a baseline task for character recognition on EMNIST.
The goal of the task is to minimize the sparse categorical crossentropy
between the output labels of the model and the true label of the image. When
`only_digits = True`, there are 10 possible labels (the digits 0-9), while
when `only_digits = False`, there are 62 possible labels (both numbers and
letters).
This classification can be done using a number of different models, specified
using the `model_id` argument. Below we give a list of the different models
that can be used:
* `model_id = cnn_dropout`: A moderately sized convolutional network. Uses
two convolutional layers, a max pooling layer, and dropout, followed by two
dense layers.
* `model_id = cnn`: A moderately sized convolutional network, without any
dropout layers. Matches the architecture of the convolutional network used
by (McMahan et al., 2017) for the purposes of testing the FedAvg algorithm.
* `model_id = 2nn`: A densely connected network with 2 hidden layers, each
with 200 hidden units and ReLU activations.
Args:
train_client_spec: A `tff.simulation.baselines.ClientSpec` specifying how to
preprocess train client data.
eval_client_spec: An optional `tff.simulation.baselines.ClientSpec`
specifying how to preprocess evaluation client data. If set to `None`, the
evaluation datasets will use a batch size of 64 with no extra
preprocessing.
model_id: A string identifier for a character recognition model. Must be one
of 'cnn_dropout', 'cnn', or '2nn'. These correspond respectively to a CNN
model with dropout, a CNN model with no dropout, and a densely connected
network with two hidden layers of width 200.
only_digits: A boolean indicating whether to use the full EMNIST-62 dataset
containing 62 alphanumeric classes (`True`) or the smaller EMNIST-10
dataset with only 10 numeric classes (`False`).
cache_dir: An optional directory to cache the downloadeded datasets. If
`None`, they will be cached to `~/.tff/`.
use_synthetic_data: A boolean indicating whether to use synthetic EMNIST
data. This option should only be used for testing purposes, in order to
avoid downloading the entire EMNIST dataset.
Returns:
A `tff.simulation.baselines.BaselineTask`.
"""
if use_synthetic_data:
synthetic_data = emnist.get_synthetic()
emnist_train = synthetic_data
emnist_test = synthetic_data
else:
emnist_train, emnist_test = emnist.load_data(
only_digits=only_digits, cache_dir=cache_dir)
return create_character_recognition_task_from_datasets(
train_client_spec, eval_client_spec, model_id, only_digits, emnist_train,
emnist_test)<|fim▁end|> |
train_preprocess_fn = emnist_preprocessing.create_preprocess_fn( |
<|file_name|>routes.js<|end_file_name|><|fim▁begin|>var _ = require('lodash'),
restify = require('restify'),
async = require('async');
module.exports = function(settings, server, db){
var globalLogger = require(settings.path.root('logger'));
var auth = require(settings.path.lib('auth'))(settings, db);
var api = require(settings.path.lib('api'))(settings, db);
var vAlpha = function(path){ return {path: path, version: settings.get("versions:alpha")} };
function context(req){
return {logger: req.log};
}
server.get(vAlpha('/ping'), function(req, res, next){
res.json();
next();
});
/**
* API to create or update an email template. If a template exists (accountId + Name pair), it will be updated. Otherwise a new one will be created
*/
server.post(vAlpha('/email/:name'), auth, function(req, res, next){
var logger = req.log || globalLogger;
var params = req.params;
if (!params || !params.name || !params.htmlData || !params.htmlType || !params.cssData || !params.cssType){
var err = new restify.BadRequestError("Invalid arguments");
logger.info(err, params);
return res.send(err);
}
api.email.createOrUpdate.call(context(req), params.accountId, params.name, params.htmlData, params.htmlType, params.cssData, params.cssType, function(err){
if (err) {
logger.error(err);
res.send(new restify.InternalServerError("Something went wrong"));
}
else {
res.json();
}
next();
});
});
server.put(vAlpha('/trigger/:name/on/event'), auth, function(req, res, next){
var logger = req.log || globalLogger;
var params = req.params;
if (!params.accountId || !params.name || !params.actionId || !params.eventName) {
var err = new restify.BadRequestError("Invalid arguments");
logger.info(err, params);
return res.send(err);
}
var eventCondition = {
name: params.eventName,
attrs: params.eventAttrs
};
api.trigger.create.call(context(req),<|fim▁hole|> params.accountId, params.name, eventCondition, null, params.actionId,
function(err, triggerDoc){
if (err){
logger.error(err);
res.send(new restify.InternalServerError("Something went wrong"));
}
else {
res.json({id: triggerDoc.id})
}
next();
})
});
server.put(vAlpha('/trigger/:name/on/time'), auth, function(req, res, next){
var logger = req.log || globalLogger;
var params = req.params;
if (!params.accountId || !params.name || !params.actionId || (!params.next && !params.every)) {
var err = new restify.BadRequestError("Invalid arguments");
logger.info(err, params);
return res.send(err);
}
var timeCondition = {
next: params.next,
every: params.every
};
api.trigger.create.call(context(req),
params.accountId, params.name, null, timeCondition, params.actionId,
function(err, triggerDoc){
if (err){
logger.error(err);
res.send(new restify.InternalServerError("Something went wrong"));
}
else {
res.json({id: triggerDoc.id})
}
next();
})
});
server.post(vAlpha('/event/:name'), auth, function(req, res, next){
var logger = req.log || globalLogger;
var params = req.params;
if (!params.accountId || !params.name || !params.userId){
var err = restify.BadRequestError("Invalid Arguments");
logger.info(err, params);
return res.send(err);
}
api.event.add.call(context(req),
params.accountId, params.name, params.userId, params.attrs,
function(err){
if (err){
logger.error(err);
res.send(new restify.InternalServerError("Something went wrong"));
}
else {
res.send();
}
next();
});
});
};<|fim▁end|> | |
<|file_name|>loggedusermenu.js<|end_file_name|><|fim▁begin|>'use strict';
/**
* @ngdoc directive
* @name FlyveMDM.directive:loggedUserMenu
* @description
* # loggedUserMenu
*/
angular.module('FlyveMDM')
.directive('loggedUserMenu', function () {
return {
templateUrl: 'views/loggedusermenu.html',
restrict: 'E',
link: function postLink(scope) {
scope.opened = false;
scope.fabModOpened = false;
angular.element(document.querySelector('nav > ul.menu')).css({
});
scope.$watch('fabModOpened', function (opened) {
if (opened) {
angular.element(document.querySelector('nav > ul.menu')).removeClass('fab-usermenu-closed');
} else {
angular.element(document.querySelector('nav > ul.menu')).addClass('fab-usermenu-closed');
}
});
},
scope: {},
controller: function ($scope, AuthProvider) {
var handleClickOutside = function () {
$scope.$apply(function () {
$scope.forceClose();
});
};<|fim▁hole|> $scope.toggleOpened = function ($event) {
$event.stopPropagation();
$scope.opened = !$scope.opened;
if ($scope.opened) {
angular.element(document.querySelector('html')).on('click', handleClickOutside);
}
};
$scope.forceClose = function () {
$scope.opened = false;
angular.element(document.querySelector('html')).off('click', handleClickOutside);
return true;
};
$scope.disconnect = function () {
AuthProvider.logout().then(function () {
AuthProvider.showLogin();
});
};
$scope.$on('$destroy', function () {
angular.element(document.querySelector('html')).off('click', handleClickOutside);
});
}
};
});<|fim▁end|> | |
<|file_name|>lib.rs<|end_file_name|><|fim▁begin|>extern crate ai_behavior;
extern crate find_folder;
extern crate gfx_device_gl;
extern crate graphics;
extern crate nalgebra;
extern crate ncollide;
extern crate piston_window;
extern crate rand;
extern crate sprite;
extern crate uuid;
mod mobs;
use gfx_device_gl::Resources;
use graphics::Image;
use graphics::rectangle::square;
use piston_window::*;
use mobs::{Hero, Star};
use sprite::*;<|fim▁hole|> player: Hero,
stars: Vec<Star>,
diag: bool,
pause: bool,
victory: bool,
loss: bool,
}
const TILE_SIZE: u32 = 64;
impl Game {
pub fn new(w: &mut PistonWindow) -> Game {
let mut scene = Scene::new();
let mut stars: Vec<Star> = vec![];
for number in 1..7 {
let color = match number % 4 {
1 => "yellow",
2 => "green",
3 => "blue",
_ => "pink",
};
stars.push(Star::new(color, w, &mut scene));
}
let player = Hero::new(w, &mut scene);
Game {
scene: scene,
player: player,
stars: stars,
diag: false,
pause: false,
victory: false,
loss: false,
}
}
pub fn on_update(&mut self, e: &Input, upd: UpdateArgs, w: &PistonWindow) {
if self.pause || self.victory || self.loss {
return;
}
self.scene.event(e);
let mut grew = false;
for mut star in &mut self.stars {
if !star.destroyed && self.player.collides(&star) {
star.destroy(&mut self.scene, upd.dt);
self.player.grow(&mut self.scene, upd.dt);
grew = true;
} else {
star.mov(w, &mut self.scene, upd.dt);
}
}
if self.stars.iter().all(|star| star.destroyed) {
self.victory = true;
self.loss = false;
return;
}
if !grew {
self.player.shrink(&mut self.scene, upd.dt);
}
if self.player.size > 0.0 {
self.player.mov(w, &mut self.scene, upd.dt);
} else {
self.loss = true;
self.victory = false;
}
}
pub fn on_draw(&mut self, e: &Input, _: RenderArgs, w: &mut PistonWindow) {
let assets = find_folder::Search::ParentsThenKids(3, 3)
.for_folder("assets")
.unwrap();
let ref font = assets.join("Fresca-Regular.ttf");
let factory = w.factory.clone();
let mut glyphs = Glyphs::new(font, factory).unwrap();
let Size { height, width } = w.size();
let image = Image::new().rect(square(0.0, 0.0, width as f64));
let bg = Texture::from_path(&mut w.factory,
assets.join("bg.png"),
Flip::None,
&TextureSettings::new()).unwrap();
w.draw_2d(e, |c, g| {
clear([1.0, 1.0, 1.0, 1.0], g);
let cols = width / TILE_SIZE;
// 4:3 means rows will be fractional so add one to cover completely
let tile_count = cols * (height / TILE_SIZE + 1);
for number in 0..tile_count {
let x: f64 = (number % cols * TILE_SIZE).into();
let y: f64 = (number / cols * TILE_SIZE).into();
image.draw(&bg, &Default::default(), c.transform.trans(x, y).zoom(1.0 / cols as f64), g);
}
if self.victory {
text::Text::new_color([0.0, 1.0, 0.0, 1.0], height / 10).draw(
"Hurray! You win!",
&mut glyphs,
&c.draw_state,
c.transform.trans(width as f64 / 2.0 - width as f64 / 4.5, height as f64 / 2.0), g
);
return;
} else if self.loss {
text::Text::new_color([0.0, 1.0, 0.0, 1.0], height / 10).draw(
"Aw! You lose!",
&mut glyphs,
&c.draw_state,
c.transform.trans(width as f64 / 2.0 - width as f64 / 4.5, height as f64 / 2.0), g
);
return;
}
if self.diag {
text::Text::new_color([0.0, 1.0, 0.0, 1.0], 10).draw(
&format!("{}", self.player.diag()),
&mut glyphs,
&c.draw_state,
c.transform.trans(10.0, 10.0), g
);
}
self.scene.draw(c.transform, g);
});
}
// TODO use an enum to track requested movement direction
pub fn on_input(&mut self, inp: Input) {
match inp {
Input::Press(but) => {
match but {
Button::Keyboard(Key::Up) => {
self.player.dir = (self.player.dir.0, -1.0);
}
Button::Keyboard(Key::Down) => {
self.player.dir = (self.player.dir.0, 1.0);
}
Button::Keyboard(Key::Left) => {
self.player.dir = (-1.0, self.player.dir.1);
}
Button::Keyboard(Key::Right) => {
self.player.dir = (1.0, self.player.dir.1);
}
_ => {}
}
}
Input::Release(but) => {
match but {
Button::Keyboard(Key::Up) => {
self.player.dir = (self.player.dir.0, 0.0);
}
Button::Keyboard(Key::Down) => {
self.player.dir = (self.player.dir.0, 0.0);
}
Button::Keyboard(Key::Left) => {
self.player.dir = (0.0, self.player.dir.1);
}
Button::Keyboard(Key::Right) => {
self.player.dir = (0.0, self.player.dir.1);
}
Button::Keyboard(Key::H) => {
self.diag = !self.diag;
}
Button::Keyboard(Key::P) => {
self.pause = !self.pause;
}
_ => {}
}
}
_ => {}
}
}
}<|fim▁end|> |
pub struct Game {
scene: Scene<Texture<Resources>>, |
<|file_name|>extract.py<|end_file_name|><|fim▁begin|># -*- coding: utf8 -*-
# Extract entities from text
#
# Author: Romary Dupuis <[email protected]>
#
# Copyright (C) 2016 Romary Dupuis
# Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html
from commis import Command
from commis import color
from feet.entities.extractor import Extractor
from feet.entities.registry import Registry
class ExtractCommand(Command):
name = 'extract'
help = 'extract a list of entities from text'
args = {
'--text': {
'metavar': 'TEXT',
'required': False,
'help': 'plain text'
},
'--registry': {
'metavar': 'REGISTRY',
'default': 'feet',
'required': False,
'help': 'registry of entities'
},
'--entity': {
'metavar': 'ENTITY',
'required': True,
'help': 'entity dictionary'
},
'--grammar': {
'metavar': 'GRAMMAR',
'required': False,
'help': 'grammar that defines entities in a sentence'
},
'--path': {
'metavar': 'PATH',
'required': False,
'help': 'path to the file that will be processed'
},
'--lang': {<|fim▁hole|> '--prefix': {
'metavar': 'PREFIX',
'default': 'feet',
'help': 'prefix used for all keys of entity'
}
}
def handle(self, args):
"""
CLI to extract entities from text.
"""
if args.text is None and args.path is None:
return color.format('* no text source specified', color.RED)
registry = Registry.find_or_create(args.registry,
key_prefix=args.prefix)
entity = registry.get_dict(args.entity)
engine = Extractor(entity, args.grammar)
if args.path is not None:
text = open(args.path).read()
else:
text = args.text
results = engine.extract(text, args.lang)
entities = []
for element in results[0]:
if element['entity_found'] == 1:
entities = list(set(entities).union(
element['entity_candidates']))
if len(entities) > 0:
print(color.format('%d entities detected' % len(entities),
color.GREEN))
print('\n'.join(entities))
else:
print(color.format('no entities detected', color.RED))
# print(color.format('%d' % results[1].elapsed, color.LIGHT_MAGENTA))
return '* text processed according to %s entity' %\
(color.format(args.entity, color.GREEN))<|fim▁end|> | 'metavar': 'LANG',
'default': 'en',
'help': 'language of text: en, ja, fr etc.'
}, |
<|file_name|>bitporno.py<|end_file_name|><|fim▁begin|>'''<|fim▁hole|> urlresolver XBMC Addon
Copyright (C) 2017
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
from urlresolver.plugins.__generic_resolver__ import GenericResolver
class BitPornoResolver(GenericResolver):
#print "print UR BitPorno"
name = 'BitPorno'
domains = ['bitporno.com']
pattern = '(?://|\.)(bitporno\.com)/(?:\?v=|embed/)([a-zA-Z0-9]+)'
def get_url(self, host, media_id):
print "print UR BitPorno self, host, media_id", self,host, media_id
print "print return", self._default_get_url(host, media_id, template='http://{host}/?v={media_id}')
return self._default_get_url(host, media_id, template='http://{host}/?v={media_id}')
return "https://www.bitporno.com/?v=FM11XRJLMP"
@classmethod
def _is_enabled(cls):
return True<|fim▁end|> | |
<|file_name|>index.js<|end_file_name|><|fim▁begin|>import { InvalidArgumentError } from '../errors/InvalidArgumentError';
import { NotImplementedError } from '../errors/NotImplementedError';
import mustache from 'mustache';
import '../utils/Function';
// The base class for a control
export class Control {
// The constructor of a control
// id: The id of the control
// template: The template used for rendering the control
// localCSS: An object whose properties are CSS class names and whose values are the localized CSS class names
// The control will change the matching CSS class names in the templates.
constructor(id, template, localCSS) {
if (typeof id !== 'string' || !isNaN(id)) {
throw new InvalidArgumentError('Cannot create the control because the id is not a string');
}
if (id.length < 1) {
throw new InvalidArgumentError('Cannot create the control because the id is not a non-empty string');
}<|fim▁hole|> if (typeof template !== 'string') {
throw new InvalidArgumentError('Cannot create the control because the template is not a string');
}
this.id = id;
this.template = template;
if (template && localCSS) {
// localize the CSS class names in the templates
for (const oCN in localCSS) {
const nCN = localCSS[oCN];
this.template = this.template
.replace(new RegExp(`class="${oCN}"`, 'gi'), `class="${nCN}"`)
.replace(new RegExp(`class='${oCN}'`, 'gi'), `class='${nCN}'`);
}
}
this.controls = {};
}
// Adds a child control to the control
// control: The Control instance
addControl(control) {
if (!(control instanceof Control)) {
throw new InvalidArgumentError('Cannot add sub-control because it is invalid');
}
this.controls[control.id] = control;
}
// Removes a child control from the control
// val: Either a controlId or a Control instance
removeControl(val) {
if (val instanceof Control) {
delete this.controls[val.id];
} else {
delete this.controls[val];
}
}
// Renders the control (and all its contained controls)
// data: The object that contains the data to substitute into the template
// eventObj: Event related data for the event that caused the control to render
render(data, eventObj) {
if (this.controls) {
const controlData = {};
for (let controlId in this.controls) {
const control = this.controls[controlId];
controlData[control.constructor.getConstructorName()] = {};
controlData[control.constructor.getConstructorName()][control.id] = control.render(data, eventObj);
}
for (let key in controlData) {
data[key] = controlData[key];
}
}
return mustache.render(this.template, data);
}
// This method is invoked so the control can bind events after the DOM has been updated
// domContainerElement: The DOM container element into which the control was rendered
// eventObj: Event related data for the event that caused the control to render
onDOMUpdated(domContainerElement, eventObj) {
if (this.onDOMUpdatedNotification) {
this.onDOMUpdatedNotification(domContainerElement, eventObj);
}
if (this.controls) {
for (let controlId in this.controls) {
const control = this.controls[controlId];
control.onDOMUpdated(domContainerElement, eventObj);
}
}
}
// The Control classes that extend this type can add custom logic here to be executed after the domContainerElement
// has been updated
// domContainerElement: The DOM container element into which the control was rendered
// eventObj: Event related data for the event that caused the control to render
onDOMUpdatedNotification(domContainerElement, eventObj) {
}
};<|fim▁end|> | if (null === template || undefined === template) {
throw new InvalidArgumentError('Cannot create the control because the template cannot be null or undefined');
} |
<|file_name|>TestGroupModification.java<|end_file_name|><|fim▁begin|>package com.chisw.work.addressbook.test;
import com.chisw.work.addressbook.Data.GroupData;
import com.chisw.work.addressbook.Data.Groups;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.MatcherAssert.assertThat;
public class TestGroupModification extends TestBase {
@BeforeMethod
public void checkPreconditions() {
if (app.db().groups().size() == 0) {
app.goTo().groupPage();
app.groups().createGroupInBeforeMethod();
}
}
@Test
public void checkGroupModification() {
Groups before = app.db().groups();
GroupData modifiedGroup = before.iterator().next();
GroupData group = new GroupData()
.withId(modifiedGroup.getId()).withGroupName("test 258").withGroupLogo("Logo 123").withGroupComment("Comment 12345");
app.goTo().groupPage();
app.groups().modifyGroup(group);<|fim▁hole|> verifyGroupsListInUi();
}
}<|fim▁end|> | assertThat(app.groups().count(),equalTo(before.size()));
Groups after = app.db().groups();
assertThat(after, equalTo(before.withoutAdded(modifiedGroup).withAdded(group))); |
<|file_name|>rep.py<|end_file_name|><|fim▁begin|>#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2013 ASMlover. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list ofconditions and the following disclaimer.
#
# notice, this list of conditions and the following disclaimer in
# * Redistributions in binary form must reproduce the above copyright
# the documentation and/or other materialsprovided with the
# distribution.
#<|fim▁hole|># THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
import zmq
import signal
interrupted = False
def signal_handler(signum, frame):
global interrupted
interrupted = True
if __name__ == '__main__':
ctx = zmq.Context()
rep = ctx.socket(zmq.REP)
rep.bind('tcp://*:5555')
print 'reply init sucess ...'
try:
rep.recv()
except KeyboardInterrupt:
print 'W: interrupte received, proceeding ...'
count = 0
signal.signal(signal.SIGINT, signal_handler)
while True:
try:
msg = rep.recv(zmq.DONTWAIT)
except zmq.ZMQError:
pass
count += 1
if interrupted:
print 'W: interrupte received, Killing server ...'
break
rep.close()<|fim▁end|> | |
<|file_name|>non_ts_pseudo_class_list.rs<|end_file_name|><|fim▁begin|>/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This file contains a helper macro includes all supported non-tree-structural
* pseudo-classes.
*
* FIXME: Find a way to autogenerate this file.
*
* Expected usage is as follows:
* ```
* macro_rules! pseudo_class_macro{
* (bare: [$(($css:expr, $name:ident, $gecko_type:tt, $state:tt, $flags:tt),)*],
* string: [$(($s_css:expr, $s_name:ident, $s_gecko_type:tt, $s_state:tt, $s_flags:tt),)*]) => {
* keyword: [$(($k_css:expr, $k_name:ident, $k_gecko_type:tt, $k_state:tt, $k_flags:tt),)*]) => {
* // do stuff
* }
* }
* apply_non_ts_list!(pseudo_class_macro)
* ```
*
* The `string` and `keyword` variables will be applied to pseudoclasses that are of the form of
* functions with string or keyword arguments.
*
* Pending pseudo-classes:
*
* :scope -> <style scoped>, pending discussion.
*
* This follows the order defined in layout/style/nsCSSPseudoClassList.h when
* possible.
*
* $gecko_type can be either "_" or an ident in Gecko's CSSPseudoClassType.
* $state can be either "_" or an expression of type ElementState. If present,
* the semantics are that the pseudo-class matches if any of the bits in
* $state are set on the element.
* $flags can be either "_" or an expression of type NonTSPseudoClassFlag,
* see selector_parser.rs for more details.
*/
macro_rules! apply_non_ts_list {
($apply_macro:ident) => {
$apply_macro! {
bare: [
("-moz-table-border-nonzero", MozTableBorderNonzero, mozTableBorderNonzero, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-browser-frame", MozBrowserFrame, mozBrowserFrame, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("link", Link, link, IN_UNVISITED_STATE, _),
("any-link", AnyLink, anyLink, IN_VISITED_OR_UNVISITED_STATE, _),
("visited", Visited, visited, IN_VISITED_STATE, _),
("active", Active, active, IN_ACTIVE_STATE, _),
("checked", Checked, checked, IN_CHECKED_STATE, _),
("disabled", Disabled, disabled, IN_DISABLED_STATE, _),
("enabled", Enabled, enabled, IN_ENABLED_STATE, _),
("focus", Focus, focus, IN_FOCUS_STATE, _),
("focus-within", FocusWithin, focusWithin, IN_FOCUS_WITHIN_STATE, _),
("hover", Hover, hover, IN_HOVER_STATE, _),<|fim▁hole|> ("-moz-devtools-highlighted", MozDevtoolsHighlighted, mozDevtoolsHighlighted, IN_DEVTOOLS_HIGHLIGHTED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-styleeditor-transitioning", MozStyleeditorTransitioning, mozStyleeditorTransitioning, IN_STYLEEDITOR_TRANSITIONING_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("fullscreen", Fullscreen, fullscreen, IN_FULLSCREEN_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-full-screen", MozFullScreen, mozFullScreen, IN_FULLSCREEN_STATE, _),
// TODO(emilio): This is inconsistently named (the capital R).
("-moz-focusring", MozFocusRing, mozFocusRing, IN_FOCUSRING_STATE, _),
("-moz-broken", MozBroken, mozBroken, IN_BROKEN_STATE, _),
("-moz-loading", MozLoading, mozLoading, IN_LOADING_STATE, _),
("-moz-suppressed", MozSuppressed, mozSuppressed, IN_SUPPRESSED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-has-dir-attr", MozHasDirAttr, mozHasDirAttr, IN_HAS_DIR_ATTR_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-dir-attr-ltr", MozDirAttrLTR, mozDirAttrLTR, IN_HAS_DIR_ATTR_LTR_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-dir-attr-rtl", MozDirAttrRTL, mozDirAttrRTL, IN_HAS_DIR_ATTR_RTL_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-dir-attr-like-auto", MozDirAttrLikeAuto, mozDirAttrLikeAuto, IN_HAS_DIR_ATTR_LIKE_AUTO_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-autofill", MozAutofill, mozAutofill, IN_AUTOFILL_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-autofill-preview", MozAutofillPreview, mozAutofillPreview, IN_AUTOFILL_PREVIEW_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-handler-clicktoplay", MozHandlerClickToPlay, mozHandlerClickToPlay, IN_HANDLER_CLICK_TO_PLAY_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-handler-vulnerable-updatable", MozHandlerVulnerableUpdatable, mozHandlerVulnerableUpdatable, IN_HANDLER_VULNERABLE_UPDATABLE_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-handler-vulnerable-no-update", MozHandlerVulnerableNoUpdate, mozHandlerVulnerableNoUpdate, IN_HANDLER_VULNERABLE_NO_UPDATE_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-handler-disabled", MozHandlerDisabled, mozHandlerDisabled, IN_HANDLER_DISABLED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-handler-blocked", MozHandlerBlocked, mozHandlerBlocked, IN_HANDLER_BLOCKED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-handler-crashed", MozHandlerCrashed, mozHandlerCrashed, IN_HANDLER_CRASHED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-math-increment-script-level", MozMathIncrementScriptLevel, mozMathIncrementScriptLevel, IN_INCREMENT_SCRIPT_LEVEL_STATE, _),
("required", Required, required, IN_REQUIRED_STATE, _),
("optional", Optional, optional, IN_OPTIONAL_STATE, _),
("valid", Valid, valid, IN_VALID_STATE, _),
("invalid", Invalid, invalid, IN_INVALID_STATE, _),
("in-range", InRange, inRange, IN_INRANGE_STATE, _),
("out-of-range", OutOfRange, outOfRange, IN_OUTOFRANGE_STATE, _),
("default", Default, defaultPseudo, IN_DEFAULT_STATE, _),
("placeholder-shown", PlaceholderShown, placeholderShown, IN_PLACEHOLDER_SHOWN_STATE, _),
("-moz-read-only", MozReadOnly, mozReadOnly, IN_MOZ_READONLY_STATE, _),
("-moz-read-write", MozReadWrite, mozReadWrite, IN_MOZ_READWRITE_STATE, _),
("-moz-submit-invalid", MozSubmitInvalid, mozSubmitInvalid, IN_MOZ_SUBMITINVALID_STATE, _),
("-moz-ui-valid", MozUIValid, mozUIValid, IN_MOZ_UI_VALID_STATE, _),
("-moz-ui-invalid", MozUIInvalid, mozUIInvalid, IN_MOZ_UI_INVALID_STATE, _),
("-moz-meter-optimum", MozMeterOptimum, mozMeterOptimum, IN_OPTIMUM_STATE, _),
("-moz-meter-sub-optimum", MozMeterSubOptimum, mozMeterSubOptimum, IN_SUB_OPTIMUM_STATE, _),
("-moz-meter-sub-sub-optimum", MozMeterSubSubOptimum, mozMeterSubSubOptimum, IN_SUB_SUB_OPTIMUM_STATE, _),
("-moz-user-disabled", MozUserDisabled, mozUserDisabled, IN_USER_DISABLED_STATE, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS_AND_CHROME),
("-moz-first-node", MozFirstNode, firstNode, _, _),
("-moz-last-node", MozLastNode, lastNode, _, _),
("-moz-only-whitespace", MozOnlyWhitespace, mozOnlyWhitespace, _, _),
("-moz-native-anonymous", MozNativeAnonymous, mozNativeAnonymous, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-use-shadow-tree-root", MozUseShadowTreeRoot, mozUseShadowTreeRoot, _, PSEUDO_CLASS_ENABLED_IN_UA_SHEETS),
("-moz-is-html", MozIsHTML, mozIsHTML, _, _),
("-moz-placeholder", MozPlaceholder, mozPlaceholder, _, _),
("-moz-lwtheme", MozLWTheme, mozLWTheme, _, _),
("-moz-lwtheme-brighttext", MozLWThemeBrightText, mozLWThemeBrightText, _, _),
("-moz-lwtheme-darktext", MozLWThemeDarkText, mozLWThemeDarkText, _, _),
("-moz-window-inactive", MozWindowInactive, mozWindowInactive, _, _),
],
string: [
("lang", Lang, lang, _, _),
]
}
}
}<|fim▁end|> | ("-moz-drag-over", MozDragOver, mozDragOver, IN_DRAGOVER_STATE, _),
("target", Target, target, IN_TARGET_STATE, _),
("indeterminate", Indeterminate, indeterminate, IN_INDETERMINATE_STATE, _), |
<|file_name|>root_bsd.go<|end_file_name|><|fim▁begin|><|fim▁hole|>// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build dragonfly freebsd netbsd openbsd rumprun
package x509
// Possible certificate files; stop after finding one.
var certFiles = []string{
"/etc/openssl/cert.pem", // Rumprun
"/usr/local/share/certs/ca-root-nss.crt", // FreeBSD/DragonFly
"/etc/ssl/cert.pem", // OpenBSD
"/etc/openssl/certs/ca-certificates.crt", // NetBSD
}<|fim▁end|> | // Copyright 2015 The Go Authors. All rights reserved. |
<|file_name|>iterutils.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
""":mod:`itertools` is full of great examples of Python generator
usage. However, there are still some critical gaps. ``iterutils``
fills many of those gaps with featureful, tested, and Pythonic
solutions.
Many of the functions below have two versions, one which
returns an iterator (denoted by the ``*_iter`` naming pattern), and a
shorter-named convenience form that returns a list. Some of the
following are based on examples in itertools docs.
"""
import math
import random
import itertools
from collections import Mapping, Sequence, Set, ItemsView
try:
from typeutils import make_sentinel
_UNSET = make_sentinel('_UNSET')
_REMAP_EXIT = make_sentinel('_REMAP_EXIT')
except ImportError:
_REMAP_EXIT = object()
_UNSET = object()
try:
from itertools import izip
except ImportError:
# Python 3 compat
basestring = (str, bytes)
izip, xrange = zip, range
def is_iterable(obj):
"""Similar in nature to :func:`callable`, ``is_iterable`` returns
``True`` if an object is `iterable`_, ``False`` if not.
>>> is_iterable([])
True
>>> is_iterable(object())
False
.. _iterable: https://docs.python.org/2/glossary.html#term-iterable
"""
try:
iter(obj)
except TypeError:
return False
return True
def is_scalar(obj):
"""A near-mirror of :func:`is_iterable`. Returns ``False`` if an
object is an iterable container type. Strings are considered
scalar as well, because strings are more often treated as whole
values as opposed to iterables of 1-character substrings.
>>> is_scalar(object())
True
>>> is_scalar(range(10))
False
>>> is_scalar('hello')
True
"""
return not is_iterable(obj) or isinstance(obj, basestring)
def is_collection(obj):
"""The opposite of :func:`is_scalar`. Returns ``True`` if an object
is an iterable other than a string.
>>> is_collection(object())
False
>>> is_collection(range(10))
True
>>> is_collection('hello')
False
"""
return is_iterable(obj) and not isinstance(obj, basestring)
def split(src, sep=None, maxsplit=None):
"""Splits an iterable based on a separator. Like :meth:`str.split`,
but for all iterables. Returns a list of lists.
>>> split(['hi', 'hello', None, None, 'sup', None, 'soap', None])
[['hi', 'hello'], ['sup'], ['soap']]
See :func:`split_iter` docs for more info.
"""
return list(split_iter(src, sep, maxsplit))
def split_iter(src, sep=None, maxsplit=None):
"""Splits an iterable based on a separator, *sep*, a max of
*maxsplit* times (no max by default). *sep* can be:
* a single value
* an iterable of separators
* a single-argument callable that returns True when a separator is
encountered
``split_iter()`` yields lists of non-separator values. A separator will
never appear in the output.
>>> list(split_iter(['hi', 'hello', None, None, 'sup', None, 'soap', None]))
[['hi', 'hello'], ['sup'], ['soap']]
Note that ``split_iter`` is based on :func:`str.split`, so if
*sep* is ``None``, ``split()`` **groups** separators. If empty lists
are desired between two contiguous ``None`` values, simply use
``sep=[None]``:
>>> list(split_iter(['hi', 'hello', None, None, 'sup', None]))
[['hi', 'hello'], ['sup']]
>>> list(split_iter(['hi', 'hello', None, None, 'sup', None], sep=[None]))
[['hi', 'hello'], [], ['sup'], []]
Using a callable separator:
>>> falsy_sep = lambda x: not x
>>> list(split_iter(['hi', 'hello', None, '', 'sup', False], falsy_sep))
[['hi', 'hello'], [], ['sup'], []]
See :func:`split` for a list-returning version.
"""
if not is_iterable(src):
raise TypeError('expected an iterable')
if maxsplit is not None:
maxsplit = int(maxsplit)
if maxsplit == 0:
yield [src]
return
if callable(sep):
sep_func = sep
elif not is_scalar(sep):
sep = frozenset(sep)
sep_func = lambda x: x in sep
else:
sep_func = lambda x: x == sep
cur_group = []
split_count = 0
for s in src:
if maxsplit is not None and split_count >= maxsplit:
sep_func = lambda x: False
if sep_func(s):
if sep is None and not cur_group:
# If sep is none, str.split() "groups" separators
# check the str.split() docs for more info
continue
split_count += 1
yield cur_group
cur_group = []
else:
cur_group.append(s)
if cur_group or sep is not None:
yield cur_group
return
def chunked(src, size, count=None, **kw):
"""Returns a list of *count* chunks, each with *size* elements,
generated from iterable *src*. If *src* is not evenly divisible by
*size*, the final chunk will have fewer than *size* elements.
Provide the *fill* keyword argument to provide a pad value and
enable padding, otherwise no padding will take place.
>>> chunked(range(10), 3)
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
>>> chunked(range(10), 3, fill=None)
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, None, None]]
>>> chunked(range(10), 3, count=2)
[[0, 1, 2], [3, 4, 5]]
See :func:`chunked_iter` for more info.
"""
chunk_iter = chunked_iter(src, size, **kw)
if count is None:
return list(chunk_iter)
else:
return list(itertools.islice(chunk_iter, count))
def chunked_iter(src, size, **kw):
"""Generates *size*-sized chunks from *src* iterable. Unless the
optional *fill* keyword argument is provided, iterables not even
divisible by *size* will have a final chunk that is smaller than
*size*.
>>> list(chunked_iter(range(10), 3))
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]]
>>> list(chunked_iter(range(10), 3, fill=None))
[[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, None, None]]
Note that ``fill=None`` in fact uses ``None`` as the fill value.
"""
# TODO: add count kwarg?
if not is_iterable(src):
raise TypeError('expected an iterable')
size = int(size)
if size <= 0:
raise ValueError('expected a positive integer chunk size')
do_fill = True
try:
fill_val = kw.pop('fill')
except KeyError:
do_fill = False
fill_val = None
if kw:
raise ValueError('got unexpected keyword arguments: %r' % kw.keys())
if not src:
return
postprocess = lambda chk: chk
if isinstance(src, basestring):
postprocess = lambda chk, _sep=type(src)(): _sep.join(chk)
cur_chunk = []
i = 0
for item in src:
cur_chunk.append(item)
i += 1
if i % size == 0:
yield postprocess(cur_chunk)
cur_chunk = []
if cur_chunk:
if do_fill:
lc = len(cur_chunk)
cur_chunk[lc:] = [fill_val] * (size - lc)
yield postprocess(cur_chunk)
return
def pairwise(src):
"""Convenience function for calling :func:`windowed` on *src*, with
*size* set to 2.
>>> pairwise(range(5))
[(0, 1), (1, 2), (2, 3), (3, 4)]
>>> pairwise([])
[]
The number of pairs is always one less than the number of elements
in the iterable passed in, except on empty inputs, which returns
an empty list.
"""
return windowed(src, 2)
def pairwise_iter(src):
"""Convenience function for calling :func:`windowed_iter` on *src*,
with *size* set to 2.
>>> list(pairwise_iter(range(5)))
[(0, 1), (1, 2), (2, 3), (3, 4)]
>>> list(pairwise_iter([]))
[]
The number of pairs is always one less than the number of elements
in the iterable passed in, or zero, when *src* is empty.
"""
return windowed_iter(src, 2)
def windowed(src, size):
"""Returns tuples with exactly length *size*. If the iterable is
too short to make a window of length *size*, no tuples are
returned. See :func:`windowed_iter` for more.
"""
return list(windowed_iter(src, size))
def windowed_iter(src, size):
"""Returns tuples with length *size* which represent a sliding
window over iterable *src*.
>>> list(windowed_iter(range(7), 3))
[(0, 1, 2), (1, 2, 3), (2, 3, 4), (3, 4, 5), (4, 5, 6)]
If the iterable is too short to make a window of length *size*,
then no window tuples are returned.
>>> list(windowed_iter(range(3), 5))
[]
"""
# TODO: lists? (for consistency)
tees = itertools.tee(src, size)
try:
for i, t in enumerate(tees):
for _ in xrange(i):
next(t)
except StopIteration:
return izip([])
return izip(*tees)
def xfrange(stop, start=None, step=1.0):
"""Same as :func:`frange`, but generator-based instead of returning a
list.
>>> tuple(xfrange(1, 3, step=0.75))
(1.0, 1.75, 2.5)
See :func:`frange` for more details.
"""
if not step:
raise ValueError('step must be non-zero')
if start is None:
start, stop = 0.0, stop * 1.0
else:
# swap when all args are used
stop, start = start * 1.0, stop * 1.0
cur = start
while cur < stop:
yield cur
cur += step
def frange(stop, start=None, step=1.0):
"""A :func:`range` clone for float-based ranges.
>>> frange(5)
[0.0, 1.0, 2.0, 3.0, 4.0]
>>> frange(6, step=1.25)
[0.0, 1.25, 2.5, 3.75, 5.0]
>>> frange(100.5, 101.5, 0.25)
[100.5, 100.75, 101.0, 101.25]
>>> frange(5, 0)
[]
>>> frange(5, 0, step=-1.25)
[5.0, 3.75, 2.5, 1.25]
"""
if not step:
raise ValueError('step must be non-zero')
if start is None:
start, stop = 0.0, stop * 1.0
else:
# swap when all args are used
stop, start = start * 1.0, stop * 1.0
count = int(math.ceil((stop - start) / step))
ret = [None] * count
if not ret:
return ret
ret[0] = start
for i in xrange(1, count):
ret[i] = ret[i - 1] + step
return ret
def backoff(start, stop, count=None, factor=2.0, jitter=False):
"""Returns a list of geometrically-increasing floating-point numbers,
suitable for usage with `exponential backoff`_. Exactly like
:func:`backoff_iter`, but without the ``'repeat'`` option for
*count*. See :func:`backoff_iter` for more details.
.. _exponential backoff: https://en.wikipedia.org/wiki/Exponential_backoff
>>> backoff(1, 10)
[1.0, 2.0, 4.0, 8.0, 10.0]
"""
if count == 'repeat':
raise ValueError("'repeat' supported in backoff_iter, not backoff")
return list(backoff_iter(start, stop, count=count,
factor=factor, jitter=jitter))
def backoff_iter(start, stop, count=None, factor=2.0, jitter=False):
"""Generates a sequence of geometrically-increasing floats, suitable
for usage with `exponential backoff`_. Starts with *start*,
increasing by *factor* until *stop* is reached, optionally
stopping iteration once *count* numbers are yielded. *factor*
defaults to 2. In general retrying with properly-configured
backoff creates a better-behaved component for a larger service
ecosystem.
.. _exponential backoff: https://en.wikipedia.org/wiki/Exponential_backoff
>>> list(backoff_iter(1.0, 10.0, count=5))
[1.0, 2.0, 4.0, 8.0, 10.0]
>>> list(backoff_iter(1.0, 10.0, count=8))
[1.0, 2.0, 4.0, 8.0, 10.0, 10.0, 10.0, 10.0]
>>> list(backoff_iter(0.25, 100.0, factor=10))
[0.25, 2.5, 25.0, 100.0]
A simplified usage example:
.. code-block:: python
for timeout in backoff_iter(0.25, 5.0):
try:
res = network_call()
break
except Exception as e:
log(e)
time.sleep(timeout)
An enhancement for large-scale systems would be to add variation,
or *jitter*, to timeout values. This is done to avoid a thundering
herd on the receiving end of the network call.
Finally, for *count*, the special value ``'repeat'`` can be passed to
continue yielding indefinitely.
Args:
start (float): Positive number for baseline.
stop (float): Positive number for maximum.
count (int): Number of steps before stopping
iteration. Defaults to the number of steps between *start* and
*stop*. Pass the string, `'repeat'`, to continue iteration
indefinitely.
factor (float): Rate of exponential increase. Defaults to `2.0`,
e.g., `[1, 2, 4, 8, 16]`.
jitter (float): A factor between `-1.0` and `1.0`, used to
uniformly randomize and thus spread out timeouts in a distributed
system, avoiding rhythm effects. Positive values use the base
backoff curve as a maximum, negative values use the curve as a
minimum. Set to 1.0 or `True` for a jitter approximating
Ethernet's time-tested backoff solution. Defaults to `False`.
"""
start = float(start)
stop = float(stop)
factor = float(factor)
if start < 0.0:
raise ValueError('expected start >= 0, not %r' % start)
if factor < 1.0:
raise ValueError('expected factor >= 1.0, not %r' % factor)
if stop == 0.0:
raise ValueError('expected stop >= 0')
if stop < start:
raise ValueError('expected stop >= start, not %r' % stop)
if count is None:
denom = start if start else 1
count = 1 + math.ceil(math.log(stop/denom, factor))
count = count if start else count + 1
if count != 'repeat' and count < 0:
raise ValueError('count must be positive or "repeat", not %r' % count)
if jitter:
jitter = float(jitter)
if not (-1.0 <= jitter <= 1.0):
raise ValueError('expected jitter -1 <= j <= 1, not: %r' % jitter)
cur, i = start, 0
while count == 'repeat' or i < count:
if not jitter:
cur_ret = cur
elif jitter:
cur_ret = cur - (cur * jitter * random.random())
yield cur_ret
i += 1
if cur == 0:
cur = 1
elif cur < stop:
cur *= factor
if cur > stop:
cur = stop
return
def bucketize(src, key=None):
"""Group values in the *src* iterable by the value returned by *key*,
which defaults to :class:`bool`, grouping values by
truthiness.
>>> bucketize(range(5))
{False: [0], True: [1, 2, 3, 4]}
>>> is_odd = lambda x: x % 2 == 1
>>> bucketize(range(5), is_odd)
{False: [0, 2, 4], True: [1, 3]}
Value lists are not deduplicated:
>>> bucketize([None, None, None, 'hello'])
{False: [None, None, None], True: ['hello']}
Note in these examples there were at most two keys, ``True`` and
``False``, and each key present has a list with at least one
item. See :func:`partition` for a version specialized for binary
use cases.
"""
if not is_iterable(src):
raise TypeError('expected an iterable')
if key is None:
key = bool
if not callable(key):
raise TypeError('expected callable key function')
ret = {}
for val in src:
keyval = key(val)
ret.setdefault(keyval, []).append(val)
return ret
def partition(src, key=None):
"""No relation to :meth:`str.partition`, ``partition`` is like
:func:`bucketize`, but for added convenience returns a tuple of
``(truthy_values, falsy_values)``.
>>> nonempty, empty = partition(['', '', 'hi', '', 'bye'])
>>> nonempty
['hi', 'bye']
*key* defaults to :class:`bool`, but can be carefully overridden to
use any function that returns either ``True`` or ``False``.
>>> import string
>>> is_digit = lambda x: x in string.digits
>>> decimal_digits, hexletters = partition(string.hexdigits, is_digit)
>>> ''.join(decimal_digits), ''.join(hexletters)
('0123456789', 'abcdefABCDEF')
"""
bucketized = bucketize(src, key)
return bucketized.get(True, []), bucketized.get(False, [])
def unique(src, key=None):
"""``unique()`` returns a list of unique values, as determined by
*key*, in the order they first appeared in the input iterable,
*src*.
>>> ones_n_zeros = '11010110001010010101010'
>>> ''.join(unique(ones_n_zeros))
'10'
See :func:`unique_iter` docs for more details.
"""
return list(unique_iter(src, key))
def unique_iter(src, key=None):
"""Yield unique elements from the iterable, *src*, based on *key*,
in the order in which they first appeared in *src*.
>>> repetitious = [1, 2, 3] * 10
>>> list(unique_iter(repetitious))
[1, 2, 3]
By default, *key* is the object itself, but *key* can either be a
callable or, for convenience, a string name of the attribute on
which to uniqueify objects, falling back on identity when the
attribute is not present.
>>> pleasantries = ['hi', 'hello', 'ok', 'bye', 'yes']
>>> list(unique_iter(pleasantries, key=lambda x: len(x)))
['hi', 'hello', 'bye']
"""
if not is_iterable(src):
raise TypeError('expected an iterable, not %r' % type(src))
if key is None:
key_func = lambda x: x
elif callable(key):
key_func = key
elif isinstance(key, basestring):
key_func = lambda x: getattr(x, key, x)
else:
raise TypeError('"key" expected a string or callable, not %r' % key)
seen = set()
for i in src:
k = key_func(i)
if k not in seen:
seen.add(k)
yield i
return
def one(src, default=None, key=None):
"""Along the same lines as builtins, :func:`all` and :func:`any`, and
similar to :func:`first`, ``one()`` returns the single object in
the given iterable *src* that evaluates to ``True``, as determined
by callable *key*. If unset, *key* defaults to :class:`bool`. If
no such objects are found, *default* is returned. If *default* is
not passed, ``None`` is returned.
If *src* has more than one object that evaluates to ``True``, or
if there is no object that fulfills such condition, return
``False``. It's like an `XOR`_ over an iterable.
>>> one((True, False, False))
True
>>> one((True, False, True))
>>> one((0, 0, 'a'))
'a'
>>> one((0, False, None))
>>> one((True, True), default=False)
False
>>> bool(one(('', 1)))
True
>>> one((10, 20, 30, 42), key=lambda i: i > 40)
42
See `Martín Gaitán's original repo`_ for further use cases.
.. _Martín Gaitán's original repo: https://github.com/mgaitan/one
.. _XOR: https://en.wikipedia.org/wiki/Exclusive_or
"""
the_one = default
for i in src:
if key(i) if key else i:
if the_one:
return default
the_one = i
return the_one
def first(iterable, default=None, key=None):
"""Return first element of *iterable* that evaluates to ``True``, else
return ``None`` or optional *default*. Similar to :func:`one`.
>>> first([0, False, None, [], (), 42])
42
>>> first([0, False, None, [], ()]) is None
True
>>> first([0, False, None, [], ()], default='ohai')
'ohai'
>>> import re
>>> m = first(re.match(regex, 'abc') for regex in ['b.*', 'a(.*)'])
>>> m.group(1)
'bc'
The optional *key* argument specifies a one-argument predicate function
like that used for *filter()*. The *key* argument, if supplied, should be
in keyword form. For example, finding the first even number in an iterable:
>>> first([1, 1, 3, 4, 5], key=lambda x: x % 2 == 0)
4
Contributed by Hynek Schlawack, author of `the original standalone module`_.
.. _the original standalone module: https://github.com/hynek/first
"""
if key is None:
for el in iterable:
if el:
return el
else:
for el in iterable:
if key(el):
return el
return default
def same(iterable, ref=_UNSET):
"""``same()`` returns ``True`` when all values in *iterable* are
equal to one another, or optionally a reference value,
*ref*. Similar to :func:`all` and :func:`any` in that it evaluates
an iterable and returns a :class:`bool`. ``same()`` returns
``True`` for empty iterables.
>>> same([])
True
>>> same([1])
True
>>> same(['a', 'a', 'a'])
True
>>> same(range(20))
False
>>> same([[], []])
True
>>> same([[], []], ref='test')
False
"""
iterator = iter(iterable)
if ref is _UNSET:
try:
ref = next(iterator)
except StopIteration:
return True # those that were there were all equal
for val in iterator:
if val != ref:
return False # short circuit on first unequal value
return True
def default_visit(path, key, value):
# print('visit(%r, %r, %r)' % (path, key, value))
return key, value
# enable the extreme: monkeypatching iterutils with a different default_visit
_orig_default_visit = default_visit
def default_enter(path, key, value):
# print('enter(%r, %r)' % (key, value))
try:
iter(value)
except TypeError:
return value, False
if isinstance(value, basestring):
return value, False
elif isinstance(value, Mapping):
return value.__class__(), ItemsView(value)
elif isinstance(value, Sequence):
return value.__class__(), enumerate(value)
elif isinstance(value, Set):
return value.__class__(), enumerate(value)
return value, False
def default_exit(path, key, old_parent, new_parent, new_items):
# print('exit(%r, %r, %r, %r, %r)'
# % (path, key, old_parent, new_parent, new_items))
ret = new_parent
if isinstance(new_parent, Mapping):
new_parent.update(new_items)
elif isinstance(new_parent, Sequence):
vals = [v for i, v in new_items]
try:
new_parent.extend(vals)
except AttributeError:
ret = new_parent.__class__(vals) # tuples
elif isinstance(new_parent, Set):
vals = [v for i, v in new_items]
try:
new_parent.update(new_items)
except AttributeError:
ret = new_parent.__class__(vals) # frozensets
else:
raise RuntimeError('unexpected iterable type: %r' % type(new_parent))
return ret
def remap(root, visit=default_visit, enter=default_enter, exit=default_exit,
**kwargs):
"""The remap ("recursive map") function is used to traverse and
transform nested structures. Lists, tuples, sets, and dictionaries
are just a few of the data structures nested into heterogenous
tree-like structures that are so common in programming.
Unfortunately, Python's built-in ways to manipulate collections
are almost all flat. List comprehensions may be fast and succinct,
but they do not recurse, making it tedious to apply quick changes
or complex transforms to real-world data.
remap goes where list comprehensions cannot.
Here's an example of removing all Nones from some data:
>>> from pprint import pprint
>>> reviews = {'Star Trek': {'TNG': 10, 'DS9': 8.5, 'ENT': None},
... 'Babylon 5': 6, 'Dr. Who': None}
>>> pprint(remap(reviews, lambda p, k, v: v is not None))
{'Babylon 5': 6, 'Star Trek': {'DS9': 8.5, 'TNG': 10}}
Notice how both Nones have been removed despite the nesting in the
dictionary. Not bad for a one-liner, and that's just the beginning.
See `this remap cookbook`_ for more delicious recipes.
.. _this remap cookbook: http://sedimental.org/remap.html
remap takes four main arguments: the object to traverse and three
optional callables which determine how the remapped object will be
created.
Args:
root: The target object to traverse. By default, remap
supports iterables like :class:`list`, :class:`tuple`,
:class:`dict`, and :class:`set`, but any object traversable by
*enter* will work.
visit (callable): This function is called on every item in
*root*. It must accept three positional arguments, *path*,
*key*, and *value*. *path* is simply a tuple of parents'
keys. *visit* should return the new key-value pair. It may
also return ``True`` as shorthand to keep the old item
unmodified, or ``False`` to drop the item from the new
structure. *visit* is called after *enter*, on the new parent.
The *visit* function is called for every item in root,
including duplicate items. For traversable values, it is
called on the new parent object, after all its children
have been visited. The default visit behavior simply
returns the key-value pair unmodified.
enter (callable): This function controls which items in *root*
are traversed. It accepts the same arguments as *visit*: the
path, the key, and the value of the current item. It returns a
pair of the blank new parent, and an iterator over the items
which should be visited. If ``False`` is returned instead of
an iterator, the value will not be traversed.
The *enter* function is only called once per unique value. The
default enter behavior support mappings, sequences, and
sets. Strings and all other iterables will not be traversed.
exit (callable): This function determines how to handle items
once they have been visited. It gets the same three
arguments as the other functions -- *path*, *key*, *value*
-- plus two more: the blank new parent object returned
from *enter*, and a list of the new items, as remapped by
*visit*.
Like *enter*, the *exit* function is only called once per
unique value. The default exit behavior is to simply add
all new items to the new parent, e.g., using
:meth:`list.extend` and :meth:`dict.update` to add to the
new parent. Immutable objects, such as a :class:`tuple` or
:class:`namedtuple`, must be recreated from scratch, but
use the same type as the new parent passed back from the
*enter* function.
reraise_visit (bool): A pragmatic convenience for the *visit*
callable. When set to ``False``, remap ignores any errors
raised by the *visit* callback. Items causing exceptions
are kept. See examples for more details.
remap is designed to cover the majority of cases with just the
*visit* callable. While passing in multiple callables is very
empowering, remap is designed so very few cases should require
passing more than one function.
When passing *enter* and *exit*, it's common and easiest to build
on the default behavior. Simply add ``from boltons.iterutils import
default_enter`` (or ``default_exit``), and have your enter/exit
function call the default behavior before or after your custom
logic. See `this example`_.
Duplicate and self-referential objects (aka reference loops) are
automatically handled internally, `as shown here`_.
.. _this example: http://sedimental.org/remap.html#sort_all_lists
.. _as shown here: http://sedimental.org/remap.html#corner_cases
"""
# TODO: improve argument formatting in sphinx doc
# TODO: enter() return (False, items) to continue traverse but cancel copy?
if not callable(visit):
raise TypeError('visit expected callable, not: %r' % visit)
if not callable(enter):
raise TypeError('enter expected callable, not: %r' % enter)
if not callable(exit):
raise TypeError('exit expected callable, not: %r' % exit)
reraise_visit = kwargs.pop('reraise_visit', True)
if kwargs:
raise TypeError('unexpected keyword arguments: %r' % kwargs.keys())
path, registry, stack = (), {}, [(None, root)]
new_items_stack = []
while stack:
key, value = stack.pop()
id_value = id(value)
if key is _REMAP_EXIT:
key, new_parent, old_parent = value
id_value = id(old_parent)
path, new_items = new_items_stack.pop()
value = exit(path, key, old_parent, new_parent, new_items)
registry[id_value] = value
if not new_items_stack:
continue
elif id_value in registry:
value = registry[id_value]
else:
res = enter(path, key, value)
try:
new_parent, new_items = res
except TypeError:
# TODO: handle False?
raise TypeError('enter should return a tuple of (new_parent,'
' items_iterator), not: %r' % res)
if new_items is not False:
# traverse unless False is explicitly passed
registry[id_value] = new_parent
new_items_stack.append((path, []))
if value is not root:
path += (key,)
stack.append((_REMAP_EXIT, (key, new_parent, value)))
if new_items:
stack.extend(reversed(list(new_items)))
continue
if visit is _orig_default_visit:
# avoid function call overhead by inlining identity operation
visited_item = (key, value)
else:
try:
visited_item = visit(path, key, value)
except Exception:
if reraise_visit:
raise
visited_item = True
if visited_item is False:
continue # drop
elif visited_item is True:
visited_item = (key, value)
# TODO: typecheck?
# raise TypeError('expected (key, value) from visit(),'
# ' not: %r' % visited_item)
try:
new_items_stack[-1][1].append(visited_item)
except IndexError:
raise TypeError('expected remappable root, not: %r' % root)
return value
class PathAccessError(KeyError, IndexError, TypeError):
# TODO: could maybe get fancy with an isinstance
# TODO: should accept an idx argument
def __init__(self, exc, seg, path):
self.exc = exc
self.seg = seg
self.path = path
def __repr__(self):
cn = self.__class__.__name__
return '%s(%r, %r, %r)' % (cn, self.exc, self.seg, self.path)
def __str__(self):
return ('could not access %r from path %r, got error: %r'
% (self.seg, self.path, self.exc))
def get_path(root, path, default=_UNSET):
"""EAFP is great, but the error message on this isn't:
var_key = 'last_key'
x['key'][-1]['other_key'][var_key]
KeyError: 'last_key'
One of get_path's chief aims is to have a good exception that is
better than a plain old KeyError: 'missing_key'
"""
# TODO: integrate default
# TODO: listify kwarg? to allow indexing into sets
# TODO: raise better error on not iterable?
if isinstance(path, basestring):
path = path.split('.')
cur = root
for seg in path:<|fim▁hole|> try:
cur = cur[seg]
except (KeyError, IndexError) as exc:
raise PathAccessError(exc, seg, path)
except TypeError as exc:
# either string index in a list, or a parent that
# doesn't support indexing
try:
seg = int(seg)
cur = cur[seg]
except (ValueError, KeyError, IndexError, TypeError):
raise PathAccessError(exc, seg, path)
return cur
# TODO: get_path/set_path
# TODO: recollect()
# TODO: reiter()
"""
May actually be faster to do an isinstance check for a str path
$ python -m timeit -s "x = [1]" "x[0]"
10000000 loops, best of 3: 0.0207 usec per loop
$ python -m timeit -s "x = [1]" "try: x[0] \nexcept: pass"
10000000 loops, best of 3: 0.029 usec per loop
$ python -m timeit -s "x = [1]" "try: x[1] \nexcept: pass"
1000000 loops, best of 3: 0.315 usec per loop
# setting up try/except is fast, only around 0.01us
# actually triggering the exception takes almost 10x as long
$ python -m timeit -s "x = [1]" "isinstance(x, basestring)"
10000000 loops, best of 3: 0.141 usec per loop
$ python -m timeit -s "x = [1]" "isinstance(x, str)"
10000000 loops, best of 3: 0.131 usec per loop
$ python -m timeit -s "x = [1]" "try: x.split('.')\n except: pass"
1000000 loops, best of 3: 0.443 usec per loop
$ python -m timeit -s "x = [1]" "try: x.split('.') \nexcept AttributeError: pass"
1000000 loops, best of 3: 0.544 usec per loop
"""<|fim▁end|> | |
<|file_name|>cryptography.rs<|end_file_name|><|fim▁begin|>pub use rust_sodium::crypto::box_::curve25519xsalsa20poly1305 as crypto_box;
pub use rust_sodium::crypto::hash::sha256;
pub use rust_sodium::crypto::scalarmult::curve25519 as scalarmult;
pub use self::crypto_box::{PrecomputedKey, PublicKey, SecretKey};
use auth_failure::AuthFailure;
/// Number of bytes in a password digest.
pub const PASSWORD_DIGEST_BYTES: usize = sha256::DIGESTBYTES;
/// Implements the fancy password hashing used by the FCP, decribed in paragraph 4
/// of https://github.com/fc00/spec/blob/10b349ab11/cryptoauth.md#hello-repeathello
pub fn shared_secret_from_password(
password: &[u8],
my_perm_sk: &SecretKey,
their_perm_pk: &PublicKey,
) -> PrecomputedKey {
assert_eq!(scalarmult::SCALARBYTES, crypto_box::PUBLICKEYBYTES);
assert_eq!(scalarmult::GROUPELEMENTBYTES, crypto_box::SECRETKEYBYTES);
let product = scalarmult::scalarmult(
&scalarmult::Scalar::from_slice(&my_perm_sk.0).unwrap(),
&scalarmult::GroupElement::from_slice(&their_perm_pk.0).unwrap(),
)
.expect("their_perm_pk should not be zeroed");
let mut shared_secret_preimage = product.0.to_vec();
shared_secret_preimage.extend(&sha256::hash(password).0);
let shared_secret = sha256::hash(&shared_secret_preimage).0;
PrecomputedKey::from_slice(&shared_secret).unwrap()
}
/// AuthNone Hello packets: my_sk and their_pk are permanent keys
/// Key packets: my_sk is permanent, their_pk is temporary
/// data packets: my_sk and their_pk are temporary keys
pub fn shared_secret_from_keys(my_sk: &SecretKey, their_pk: &PublicKey) -> PrecomputedKey {
crypto_box::precompute(their_pk, my_sk)
}
/// unseals the concatenation of fields msg_auth_code, sender_encrypted_temp_pk, and
/// encrypted_data of a packet.
/// If authentication was successful, returns the sender's temp_pk and the
/// data, unencrypted.
pub fn open_packet_end(
packet_end: &[u8],
shared_secret: &PrecomputedKey,
nonce: &crypto_box::Nonce,
) -> Result<(PublicKey, Vec<u8>), AuthFailure> {
if packet_end.len() < crypto_box::MACBYTES {
return Err(AuthFailure::PacketTooShort(format!(
"Packet end: {}",
packet_end.len()
)));
}
match crypto_box::open_precomputed(packet_end, nonce, &shared_secret) {
Err(_) => Err(AuthFailure::CorruptedPacket(
"Could not decrypt handshake packet end.".to_owned(),
)),
Ok(buf) => {
let mut pk = [0u8; crypto_box::PUBLICKEYBYTES];
pk.copy_from_slice(&buf[0..crypto_box::PUBLICKEYBYTES]);<|fim▁hole|> }
}
/// Randomly generates a secret key and a corresponding public key.
///
/// THREAD SAFETY: `gen_keypair()` is thread-safe provided that you
/// have called `fcp_cryptoauth::init()` (or `rust_sodium::init()`)
/// once before using any other function from `fcp_cryptoauth` or
/// `rust_sodium`.
pub fn gen_keypair() -> (PublicKey, SecretKey) {
crypto_box::gen_keypair()
}<|fim▁end|> | let their_temp_pk = PublicKey::from_slice(&pk).unwrap();
let data = buf[crypto_box::PUBLICKEYBYTES..].to_vec();
Ok((their_temp_pk, data))
} |
<|file_name|>warequest.py<|end_file_name|><|fim▁begin|>from .waresponseparser import ResponseParser
from yowsup.env import YowsupEnv
import sys
import logging
from axolotl.ecc.curve import Curve
from axolotl.ecc.ec import ECPublicKey
from yowsup.common.tools import WATools
from cryptography.hazmat.primitives.ciphers.aead import AESGCM
from yowsup.config.v1.config import Config
from yowsup.profile.profile import YowProfile
import struct
import random
import base64
if sys.version_info < (3, 0):
import httplib
from urllib import quote as urllib_quote
if sys.version_info >= (2, 7, 9):
# see https://github.com/tgalal/yowsup/issues/677
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
else:
from http import client as httplib
from urllib.parse import quote as urllib_quote
logger = logging.getLogger(__name__)
class WARequest(object):
OK = 200
ENC_PUBKEY = Curve.decodePoint(
bytearray([
5, 142, 140, 15, 116, 195, 235, 197, 215, 166, 134, 92, 108,
60, 132, 56, 86, 176, 97, 33, 204, 232, 234, 119, 77, 34, 251,
111, 18, 37, 18, 48, 45
])
)
def __init__(self, config_or_profile):
"""
:type method: str
:param config_or_profile:
:type config: yowsup.config.v1.config.Config | YowProfile
"""
self.pvars = []
self.port = 443
self.type = "GET"
self.parser = None
self.params = []
self.headers = {}
self.sent = False
self.response = None
if isinstance(config_or_profile, Config):
logger.warning("Passing Config to WARequest is deprecated, pass a YowProfile instead")
profile = YowProfile(config_or_profile.phone, config_or_profile)
else:
assert isinstance(config_or_profile, YowProfile)
profile = config_or_profile
self._config = profile.config
config = self._config
self._p_in = str(config.phone)[len(str(config.cc)):]
self._axolotlmanager = profile.axolotl_manager
if config.expid is None:
config.expid = WATools.generateDeviceId()
if config.fdid is None:
config.fdid = WATools.generatePhoneId()
if config.client_static_keypair is None:
config.client_static_keypair = WATools.generateKeyPair()
self.addParam("cc", config.cc)
self.addParam("in", self._p_in)
self.addParam("lg", "en")
self.addParam("lc", "GB")
self.addParam("mistyped", "6")
self.addParam("authkey", self.b64encode(config.client_static_keypair.public.data))
self.addParam("e_regid", self.b64encode(struct.pack('>I', self._axolotlmanager.registration_id)))
self.addParam("e_keytype", self.b64encode(b"\x05"))
self.addParam("e_ident", self.b64encode(self._axolotlmanager.identity.publicKey.serialize()[1:]))
signedprekey = self._axolotlmanager.load_latest_signed_prekey(generate=True)
self.addParam("e_skey_id", self.b64encode(struct.pack('>I', signedprekey.getId())[1:]))
self.addParam("e_skey_val", self.b64encode(signedprekey.getKeyPair().publicKey.serialize()[1:]))
self.addParam("e_skey_sig", self.b64encode(signedprekey.getSignature()))
self.addParam("fdid", config.fdid)
self.addParam("expid", self.b64encode(config.expid))
self.addParam("network_radio_type", "1")
self.addParam("simnum", "1")
self.addParam("hasinrc", "1")
self.addParam("pid", int(random.uniform(100, 9999)))
self.addParam("rc", 0)
if self._config.id:
self.addParam("id", self._config.id)
def setParsableVariables(self, pvars):
self.pvars = pvars
def onResponse(self, name, value):
if name == "status":
self.status = value
elif name == "result":
self.result = value
def addParam(self, name, value):
self.params.append((name, value))
def removeParam(self, name):
for i in range(0, len(self.params)):
if self.params[i][0] == name:
del self.params[i]
def addHeaderField(self, name, value):
self.headers[name] = value
def clearParams(self):
self.params = []
def getUserAgent(self):
return YowsupEnv.getCurrent().getUserAgent()
def send(self, parser=None, encrypt=True, preview=False):
logger.debug("send(parser=%s, encrypt=%s, preview=%s)" % (
None if parser is None else "[omitted]",
encrypt, preview
))
if self.type == "POST":
return self.sendPostRequest(parser)
return self.sendGetRequest(parser, encrypt, preview=preview)
def setParser(self, parser):
if isinstance(parser, ResponseParser):
self.parser = parser
else:
logger.error("Invalid parser")
def getConnectionParameters(self):
if not self.url:
return "", "", self.port
try:
url = self.url.split("://", 1)
url = url[0] if len(url) == 1 else url[1]
host, path = url.split('/', 1)
except ValueError:
host = url
path = ""
path = "/" + path
return host, self.port, path
def encryptParams(self, params, key):
"""
:param params:
:type params: list
:param key:
:type key: ECPublicKey
:return:
:rtype: list
"""
keypair = Curve.generateKeyPair()
encodedparams = self.urlencodeParams(params)
cipher = AESGCM(Curve.calculateAgreement(key, keypair.privateKey))
ciphertext = cipher.encrypt(b'\x00\x00\x00\x00' + struct.pack('>Q', 0), encodedparams.encode(), b'')
payload = base64.b64encode(keypair.publicKey.serialize()[1:] + ciphertext)
return [('ENC', payload)]
def sendGetRequest(self, parser=None, encrypt_params=True, preview=False):
logger.debug("sendGetRequest(parser=%s, encrypt_params=%s, preview=%s)" % (
None if parser is None else "[omitted]",
encrypt_params, preview
))
self.response = None
if encrypt_params:
logger.debug("Encrypting parameters")
if logger.level <= logging.DEBUG:
logger.debug("pre-encrypt (encoded) parameters = \n%s", (self.urlencodeParams(self.params)))
params = self.encryptParams(self.params, self.ENC_PUBKEY)
else:
## params will be logged right before sending
params = self.params
parser = parser or self.parser or ResponseParser()
headers = dict(
list(
{
"User-Agent": self.getUserAgent(),
"Accept": parser.getMeta()
}.items()
) + list(self.headers.items()))
host, port, path = self.getConnectionParameters()
self.response = WARequest.sendRequest(host, port, path, headers, params, "GET", preview=preview)<|fim▁hole|> return None
if not self.response.status == WARequest.OK:
logger.error("Request not success, status was %s" % self.response.status)
return {}
data = self.response.read()
logger.info(data)
self.sent = True
return parser.parse(data.decode(), self.pvars)
def sendPostRequest(self, parser=None):
self.response = None
params = self.params # [param.items()[0] for param in self.params];
parser = parser or self.parser or ResponseParser()
headers = dict(list({"User-Agent": self.getUserAgent(),
"Accept": parser.getMeta(),
"Content-Type": "application/x-www-form-urlencoded"
}.items()) + list(self.headers.items()))
host, port, path = self.getConnectionParameters()
self.response = WARequest.sendRequest(host, port, path, headers, params, "POST")
if not self.response.status == WARequest.OK:
logger.error("Request not success, status was %s" % self.response.status)
return {}
data = self.response.read()
logger.info(data)
self.sent = True
return parser.parse(data.decode(), self.pvars)
def b64encode(self, value):
return base64.urlsafe_b64encode(value).replace(b'=', b'')
@classmethod
def urlencode(cls, value):
if type(value) not in (str, bytes):
value = str(value)
out = ""
for char in value:
if type(char) is int:
char = bytearray([char])
quoted = urllib_quote(char, safe='')
out += quoted if quoted[0] != '%' else quoted.lower()
return out \
.replace('-', '%2d') \
.replace('_', '%5f') \
.replace('~', '%7e')
@classmethod
def urlencodeParams(cls, params):
merged = []
for k, v in params:
merged.append(
"%s=%s" % (k, cls.urlencode(v))
)
return "&".join(merged)
@classmethod
def sendRequest(cls, host, port, path, headers, params, reqType="GET", preview=False):
logger.debug("sendRequest(host=%s, port=%s, path=%s, headers=%s, params=%s, reqType=%s, preview=%s)" % (
host, port, path, headers, params, reqType, preview
))
params = cls.urlencodeParams(params)
path = path + "?" + params if reqType == "GET" and params else path
if not preview:
logger.debug("Opening connection to %s" % host)
conn = httplib.HTTPSConnection(host, port) if port == 443 else httplib.HTTPConnection(host, port)
else:
logger.debug("Should open connection to %s, but this is a preview" % host)
conn = None
if not preview:
logger.debug("Sending %s request to %s" % (reqType, path))
conn.request(reqType, path, params, headers)
else:
logger.debug("Should send %s request to %s, but this is a preview" % (reqType, path))
return None
response = conn.getresponse()
return response<|fim▁end|> |
if preview:
logger.info("Preview request, skip response handling and return None") |
<|file_name|>httpService.js<|end_file_name|><|fim▁begin|>"use strict";
/**
* Storing multiple constant values inside of an object
* Keep in mind the values in the object mean they can be modified
* Which makes no sense for a constant, use wisely if you do this
*/
app.service('$api', ['$http', '$token', '$rootScope', '$sweetAlert', '$msg', 'SERVER_URL',
function ($http, $token, $rootScope, $sweetAlert, $msg, SERVER_URL) {
const SERVER_URI = SERVER_URL + 'api/';
var config = {
headers: {'Authorization': $token.getFromCookie() || $token.getFromLocal() || $token.getFromSession()}
};
/* Authentication Service
----------------------------------------------*/
this.isAuthorized = function (module_name) {
return $http.get(SERVER_URI + 'check_auth', {
headers: {'Authorization': $token.getFromCookie() || $token.getFromLocal() || $token.getFromSession()},
params: {'module_name': module_name}
});
};
this.authenticate = function (data) {
return $http.post(SERVER_URI + 'login', data);
};
this.resetPassword = function (email) {
return $http.post(SERVER_URI + 'reset_password', email);
};
this.exit = function () {
$token.deleteFromAllStorage();
return $http.get(SERVER_URI + 'logout', {params: {user: $rootScope.user} })
};
/* User Service
----------------------------------------------*/
this.findMember = function (params) {
config.params = params;
if (params.search) {
return $http.post(SERVER_URI + 'all_users', params.search, config);
}
return $http.get(SERVER_URI + 'all_users', config);
};
this.removeMember = function (data) {
return $http.delete(SERVER_URI + 'remove_profile/' + data, config);
};<|fim▁hole|> };
this.usersCount = function () {
return $http.get(SERVER_URI + 'users_count', config);
};
/* Shop Service
----------------------------------------------*/
this.makePayment = function (params) {
config.params = params;
return $http.get(SERVER_URI + 'execute_payment', config);
};
/* Chat Service
----------------------------------------------*/
this.getChatList = function (params) {
return $http.get(SERVER_URI+'chat_list', config);
};
this.saveMessage = function(data) {
return $http.post(SERVER_URI + 'save_message', data, config);
};
this.getConversation = function () {
};
/* Product Service
----------------------------------------------*/
this.products = function (params) {
config.params = params;
if (params.search) {
return $http.post(SERVER_URI + 'product_list', params.search, config);
}
return $http.get(SERVER_URI + 'product_list', config);
};
this.productDetail = function (id) {
config.params = {id: id};
return $http.get(SERVER_URI + 'product_detail', config);
};
this.buyProduct = function (params) {
config.params = params;
return $http.get(SERVER_URI + 'buy_product', config);
};
this.handleError = function (res) {
switch (res.status) {
case 400:
$sweetAlert.error(res.statusText, $msg.AUTHENTICATION_ERROR);
break;
case 403:
$sweetAlert.error(res.statusText, $msg.AUTHENTICATION_ERROR);
break;
case 500:
$sweetAlert.error(res.statusText, $msg.INTERNAL_SERVER_ERROR);
break;
case 503:
$sweetAlert.error(res.statusText, $msg.SERVICE_UNAVAILABLE);
break;
case 404:
$sweetAlert.error(res.statusText, $msg.NOT_FOUND_ERROR);
break;
default:
$sweetAlert.error(res.statusText, $msg.INTERNAL_SERVER_ERROR);
break;
}
};
}]);<|fim▁end|> |
this.updateUserProfile = function (data) {
return $http.put(SERVER_URI + 'update_profile', data, config); |
<|file_name|>functions1.rs<|end_file_name|><|fim▁begin|>// functions1.rs
// Make me compile! Execute `rustlings hint functions1` for hints :)
// I AM NOT DONE
fn main() {
call_me();<|fim▁hole|>}<|fim▁end|> | |
<|file_name|>test_pkcs1_pss.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
#
# SelfTest/Signature/test_pkcs1_pss.py: Self-test for PKCS#1 PSS signatures
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to the public domain is not available,
# everyone is granted a worldwide, perpetual, royalty-free,
# non-exclusive license to exercise all rights associated with the
# contents of this file for any purpose whatsoever.
# No rights are reserved.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# ===================================================================
from __future__ import nested_scopes
__revision__ = "$Id$"
import unittest
from Crypto.PublicKey import RSA
from Crypto import Random
from Crypto.SelfTest.st_common import list_test_cases, a2b_hex, b2a_hex
from Crypto.Hash import *
from Crypto.Signature import PKCS1_PSS as PKCS
from Crypto.Util.py3compat import *
def isStr(s):
t = ''
try:
t += s
except TypeError:
return 0
return 1
def rws(t):
"""Remove white spaces, tabs, and new lines from a string"""
for c in ['\t', '\n', ' ']:
t = t.replace(c,'')
return t
def t2b(t):
"""Convert a text string with bytes in hex form to a byte string"""
clean = b(rws(t))
if len(clean)%2 == 1:
raise ValueError("Even number of characters expected")
return a2b_hex(clean)
# Helper class to count how many bytes have been requested
# from the key's private RNG, w/o counting those used for blinding
class MyKey:
def __init__(self, key):
self._key = key
self.n = key.n
self.asked = 0
def _randfunc(self, N):
self.asked += N
return self._key._randfunc(N)
def sign(self, m):
return self._key.sign(m)
def has_private(self):
return self._key.has_private()
def decrypt(self, m):
return self._key.decrypt(m)
def verify(self, m, p):
return self._key.verify(m, p)
def encrypt(self, m, p):
return self._key.encrypt(m, p)
class PKCS1_PSS_Tests(unittest.TestCase):
# List of tuples with test data for PKCS#1 PSS
# Each tuple is made up by:
# Item #0: dictionary with RSA key component, or key to import
# Item #1: data to hash and sign
# Item #2: signature of the data #1, done with the key #0,
# and salt #3 after hashing it with #4
# Item #3: salt
# Item #4: hash object generator
_testData = (
#
# From in pss-vect.txt to be found in
# ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
#
(
# Private key
{
'n':'''a2 ba 40 ee 07 e3 b2 bd 2f 02 ce 22 7f 36 a1 95
02 44 86 e4 9c 19 cb 41 bb bd fb ba 98 b2 2b 0e<|fim▁hole|> 5b 22 0d d1 7d 4e a9 04 b1 ec 10 2b 2e 4d e7 75
12 22 aa 99 15 10 24 c7 cb 41 cc 5e a2 1d 00 ee
b4 1f 7c 80 08 34 d2 c6 e0 6b ce 3b ce 7e a9 a5''',
'e':'''01 00 01''',
# In the test vector, only p and q were given...
# d is computed offline as e^{-1} mod (p-1)(q-1)
'd':'''50e2c3e38d886110288dfc68a9533e7e12e27d2aa56
d2cdb3fb6efa990bcff29e1d2987fb711962860e7391b1ce01
ebadb9e812d2fbdfaf25df4ae26110a6d7a26f0b810f54875e
17dd5c9fb6d641761245b81e79f8c88f0e55a6dcd5f133abd3
5f8f4ec80adf1bf86277a582894cb6ebcd2162f1c7534f1f49
47b129151b71'''
},
# Data to sign
'''85 9e ef 2f d7 8a ca 00 30 8b dc 47 11 93 bf 55
bf 9d 78 db 8f 8a 67 2b 48 46 34 f3 c9 c2 6e 64
78 ae 10 26 0f e0 dd 8c 08 2e 53 a5 29 3a f2 17
3c d5 0c 6d 5d 35 4f eb f7 8b 26 02 1c 25 c0 27
12 e7 8c d4 69 4c 9f 46 97 77 e4 51 e7 f8 e9 e0
4c d3 73 9c 6b bf ed ae 48 7f b5 56 44 e9 ca 74
ff 77 a5 3c b7 29 80 2f 6e d4 a5 ff a8 ba 15 98
90 fc''',
# Signature
'''8d aa 62 7d 3d e7 59 5d 63 05 6c 7e c6 59 e5 44
06 f1 06 10 12 8b aa e8 21 c8 b2 a0 f3 93 6d 54
dc 3b dc e4 66 89 f6 b7 95 1b b1 8e 84 05 42 76
97 18 d5 71 5d 21 0d 85 ef bb 59 61 92 03 2c 42
be 4c 29 97 2c 85 62 75 eb 6d 5a 45 f0 5f 51 87
6f c6 74 3d ed dd 28 ca ec 9b b3 0e a9 9e 02 c3
48 82 69 60 4f e4 97 f7 4c cd 7c 7f ca 16 71 89
71 23 cb d3 0d ef 5d 54 a2 b5 53 6a d9 0a 74 7e''',
# Salt
'''e3 b5 d5 d0 02 c1 bc e5 0c 2b 65 ef 88 a1 88 d8
3b ce 7e 61''',
# Hash algorithm
SHA
),
#
# Example 1.1 to be found in
# ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
#
(
# Private key
{
'n':'''a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1
56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91
d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3
94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df
d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77
c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1
05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4
ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37''',
'e':'''01 00 01''',
'd':'''33 a5 04 2a 90 b2 7d 4f 54 51 ca 9b bb d0 b4 47
71 a1 01 af 88 43 40 ae f9 88 5f 2a 4b be 92 e8
94 a7 24 ac 3c 56 8c 8f 97 85 3a d0 7c 02 66 c8
c6 a3 ca 09 29 f1 e8 f1 12 31 88 44 29 fc 4d 9a
e5 5f ee 89 6a 10 ce 70 7c 3e d7 e7 34 e4 47 27
a3 95 74 50 1a 53 26 83 10 9c 2a ba ca ba 28 3c
31 b4 bd 2f 53 c3 ee 37 e3 52 ce e3 4f 9e 50 3b
d8 0c 06 22 ad 79 c6 dc ee 88 35 47 c6 a3 b3 25'''
},
# Message
'''cd c8 7d a2 23 d7 86 df 3b 45 e0 bb bc 72 13 26
d1 ee 2a f8 06 cc 31 54 75 cc 6f 0d 9c 66 e1 b6
23 71 d4 5c e2 39 2e 1a c9 28 44 c3 10 10 2f 15
6a 0d 8d 52 c1 f4 c4 0b a3 aa 65 09 57 86 cb 76
97 57 a6 56 3b a9 58 fe d0 bc c9 84 e8 b5 17 a3
d5 f5 15 b2 3b 8a 41 e7 4a a8 67 69 3f 90 df b0
61 a6 e8 6d fa ae e6 44 72 c0 0e 5f 20 94 57 29
cb eb e7 7f 06 ce 78 e0 8f 40 98 fb a4 1f 9d 61
93 c0 31 7e 8b 60 d4 b6 08 4a cb 42 d2 9e 38 08
a3 bc 37 2d 85 e3 31 17 0f cb f7 cc 72 d0 b7 1c
29 66 48 b3 a4 d1 0f 41 62 95 d0 80 7a a6 25 ca
b2 74 4f d9 ea 8f d2 23 c4 25 37 02 98 28 bd 16
be 02 54 6f 13 0f d2 e3 3b 93 6d 26 76 e0 8a ed
1b 73 31 8b 75 0a 01 67 d0''',
# Signature
'''90 74 30 8f b5 98 e9 70 1b 22 94 38 8e 52 f9 71
fa ac 2b 60 a5 14 5a f1 85 df 52 87 b5 ed 28 87
e5 7c e7 fd 44 dc 86 34 e4 07 c8 e0 e4 36 0b c2
26 f3 ec 22 7f 9d 9e 54 63 8e 8d 31 f5 05 12 15
df 6e bb 9c 2f 95 79 aa 77 59 8a 38 f9 14 b5 b9
c1 bd 83 c4 e2 f9 f3 82 a0 d0 aa 35 42 ff ee 65
98 4a 60 1b c6 9e b2 8d eb 27 dc a1 2c 82 c2 d4
c3 f6 6c d5 00 f1 ff 2b 99 4d 8a 4e 30 cb b3 3c''',
# Salt
'''de e9 59 c7 e0 64 11 36 14 20 ff 80 18 5e d5 7f
3e 67 76 af''',
# Hash
SHA
),
#
# Example 1.2 to be found in
# ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
#
(
# Private key
{
'n':'''a5 6e 4a 0e 70 10 17 58 9a 51 87 dc 7e a8 41 d1
56 f2 ec 0e 36 ad 52 a4 4d fe b1 e6 1f 7a d9 91
d8 c5 10 56 ff ed b1 62 b4 c0 f2 83 a1 2a 88 a3
94 df f5 26 ab 72 91 cb b3 07 ce ab fc e0 b1 df
d5 cd 95 08 09 6d 5b 2b 8b 6d f5 d6 71 ef 63 77
c0 92 1c b2 3c 27 0a 70 e2 59 8e 6f f8 9d 19 f1
05 ac c2 d3 f0 cb 35 f2 92 80 e1 38 6b 6f 64 c4
ef 22 e1 e1 f2 0d 0c e8 cf fb 22 49 bd 9a 21 37''',
'e':'''01 00 01''',
'd':'''33 a5 04 2a 90 b2 7d 4f 54 51 ca 9b bb d0 b4 47
71 a1 01 af 88 43 40 ae f9 88 5f 2a 4b be 92 e8
94 a7 24 ac 3c 56 8c 8f 97 85 3a d0 7c 02 66 c8
c6 a3 ca 09 29 f1 e8 f1 12 31 88 44 29 fc 4d 9a
e5 5f ee 89 6a 10 ce 70 7c 3e d7 e7 34 e4 47 27
a3 95 74 50 1a 53 26 83 10 9c 2a ba ca ba 28 3c
31 b4 bd 2f 53 c3 ee 37 e3 52 ce e3 4f 9e 50 3b
d8 0c 06 22 ad 79 c6 dc ee 88 35 47 c6 a3 b3 25'''
},
# Message
'''85 13 84 cd fe 81 9c 22 ed 6c 4c cb 30 da eb 5c
f0 59 bc 8e 11 66 b7 e3 53 0c 4c 23 3e 2b 5f 8f
71 a1 cc a5 82 d4 3e cc 72 b1 bc a1 6d fc 70 13
22 6b 9e''',
# Signature
'''3e f7 f4 6e 83 1b f9 2b 32 27 41 42 a5 85 ff ce
fb dc a7 b3 2a e9 0d 10 fb 0f 0c 72 99 84 f0 4e
f2 9a 9d f0 78 07 75 ce 43 73 9b 97 83 83 90 db
0a 55 05 e6 3d e9 27 02 8d 9d 29 b2 19 ca 2c 45
17 83 25 58 a5 5d 69 4a 6d 25 b9 da b6 60 03 c4
cc cd 90 78 02 19 3b e5 17 0d 26 14 7d 37 b9 35
90 24 1b e5 1c 25 05 5f 47 ef 62 75 2c fb e2 14
18 fa fe 98 c2 2c 4d 4d 47 72 4f db 56 69 e8 43''',
# Salt
'''ef 28 69 fa 40 c3 46 cb 18 3d ab 3d 7b ff c9 8f
d5 6d f4 2d''',
# Hash
SHA
),
#
# Example 2.1 to be found in
# ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
#
(
# Private key
{
'n':'''01 d4 0c 1b cf 97 a6 8a e7 cd bd 8a 7b f3 e3 4f
a1 9d cc a4 ef 75 a4 74 54 37 5f 94 51 4d 88 fe
d0 06 fb 82 9f 84 19 ff 87 d6 31 5d a6 8a 1f f3
a0 93 8e 9a bb 34 64 01 1c 30 3a d9 91 99 cf 0c
7c 7a 8b 47 7d ce 82 9e 88 44 f6 25 b1 15 e5 e9
c4 a5 9c f8 f8 11 3b 68 34 33 6a 2f d2 68 9b 47
2c bb 5e 5c ab e6 74 35 0c 59 b6 c1 7e 17 68 74
fb 42 f8 fc 3d 17 6a 01 7e dc 61 fd 32 6c 4b 33
c9''',
'e':'''01 00 01''',
'd':'''02 7d 14 7e 46 73 05 73 77 fd 1e a2 01 56 57 72
17 6a 7d c3 83 58 d3 76 04 56 85 a2 e7 87 c2 3c
15 57 6b c1 6b 9f 44 44 02 d6 bf c5 d9 8a 3e 88
ea 13 ef 67 c3 53 ec a0 c0 dd ba 92 55 bd 7b 8b
b5 0a 64 4a fd fd 1d d5 16 95 b2 52 d2 2e 73 18
d1 b6 68 7a 1c 10 ff 75 54 5f 3d b0 fe 60 2d 5f
2b 7f 29 4e 36 01 ea b7 b9 d1 ce cd 76 7f 64 69
2e 3e 53 6c a2 84 6c b0 c2 dd 48 6a 39 fa 75 b1'''
},
# Message
'''da ba 03 20 66 26 3f ae db 65 98 48 11 52 78 a5
2c 44 fa a3 a7 6f 37 51 5e d3 36 32 10 72 c4 0a
9d 9b 53 bc 05 01 40 78 ad f5 20 87 51 46 aa e7
0f f0 60 22 6d cb 7b 1f 1f c2 7e 93 60''',
# Signature
'''01 4c 5b a5 33 83 28 cc c6 e7 a9 0b f1 c0 ab 3f
d6 06 ff 47 96 d3 c1 2e 4b 63 9e d9 13 6a 5f ec
6c 16 d8 88 4b dd 99 cf dc 52 14 56 b0 74 2b 73
68 68 cf 90 de 09 9a db 8d 5f fd 1d ef f3 9b a4
00 7a b7 46 ce fd b2 2d 7d f0 e2 25 f5 46 27 dc
65 46 61 31 72 1b 90 af 44 53 63 a8 35 8b 9f 60
76 42 f7 8f ab 0a b0 f4 3b 71 68 d6 4b ae 70 d8
82 78 48 d8 ef 1e 42 1c 57 54 dd f4 2c 25 89 b5
b3''',
# Salt
'''57 bf 16 0b cb 02 bb 1d c7 28 0c f0 45 85 30 b7
d2 83 2f f7''',
SHA
),
#
# Example 8.1 to be found in
# ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1-vec.zip
#
(
# Private key
{
'n':'''49 53 70 a1 fb 18 54 3c 16 d3 63 1e 31 63 25 5d
f6 2b e6 ee e8 90 d5 f2 55 09 e4 f7 78 a8 ea 6f
bb bc df 85 df f6 4e 0d 97 20 03 ab 36 81 fb ba
6d d4 1f d5 41 82 9b 2e 58 2d e9 f2 a4 a4 e0 a2
d0 90 0b ef 47 53 db 3c ee 0e e0 6c 7d fa e8 b1
d5 3b 59 53 21 8f 9c ce ea 69 5b 08 66 8e de aa
dc ed 94 63 b1 d7 90 d5 eb f2 7e 91 15 b4 6c ad
4d 9a 2b 8e fa b0 56 1b 08 10 34 47 39 ad a0 73
3f''',
'e':'''01 00 01''',
'd':'''6c 66 ff e9 89 80 c3 8f cd ea b5 15 98 98 83 61
65 f4 b4 b8 17 c4 f6 a8 d4 86 ee 4e a9 13 0f e9
b9 09 2b d1 36 d1 84 f9 5f 50 4a 60 7e ac 56 58
46 d2 fd d6 59 7a 89 67 c7 39 6e f9 5a 6e ee bb
45 78 a6 43 96 6d ca 4d 8e e3 de 84 2d e6 32 79
c6 18 15 9c 1a b5 4a 89 43 7b 6a 61 20 e4 93 0a
fb 52 a4 ba 6c ed 8a 49 47 ac 64 b3 0a 34 97 cb
e7 01 c2 d6 26 6d 51 72 19 ad 0e c6 d3 47 db e9'''
},
# Message
'''81 33 2f 4b e6 29 48 41 5e a1 d8 99 79 2e ea cf
6c 6e 1d b1 da 8b e1 3b 5c ea 41 db 2f ed 46 70
92 e1 ff 39 89 14 c7 14 25 97 75 f5 95 f8 54 7f
73 56 92 a5 75 e6 92 3a f7 8f 22 c6 99 7d db 90
fb 6f 72 d7 bb 0d d5 74 4a 31 de cd 3d c3 68 58
49 83 6e d3 4a ec 59 63 04 ad 11 84 3c 4f 88 48
9f 20 97 35 f5 fb 7f da f7 ce c8 ad dc 58 18 16
8f 88 0a cb f4 90 d5 10 05 b7 a8 e8 4e 43 e5 42
87 97 75 71 dd 99 ee a4 b1 61 eb 2d f1 f5 10 8f
12 a4 14 2a 83 32 2e db 05 a7 54 87 a3 43 5c 9a
78 ce 53 ed 93 bc 55 08 57 d7 a9 fb''',
# Signature
'''02 62 ac 25 4b fa 77 f3 c1 ac a2 2c 51 79 f8 f0
40 42 2b 3c 5b af d4 0a 8f 21 cf 0f a5 a6 67 cc
d5 99 3d 42 db af b4 09 c5 20 e2 5f ce 2b 1e e1
e7 16 57 7f 1e fa 17 f3 da 28 05 2f 40 f0 41 9b
23 10 6d 78 45 aa f0 11 25 b6 98 e7 a4 df e9 2d
39 67 bb 00 c4 d0 d3 5b a3 55 2a b9 a8 b3 ee f0
7c 7f ec db c5 42 4a c4 db 1e 20 cb 37 d0 b2 74
47 69 94 0e a9 07 e1 7f bb ca 67 3b 20 52 23 80
c5''',
# Salt
'''1d 65 49 1d 79 c8 64 b3 73 00 9b e6 f6 f2 46 7b
ac 4c 78 fa''',
SHA
)
)
def testSign1(self):
for i in range(len(self._testData)):
# Build the key
comps = [ long(rws(self._testData[i][0][x]),16) for x in ('n','e','d') ]
key = MyKey(RSA.construct(comps))
# Hash function
h = self._testData[i][4].new()
# Data to sign
h.update(t2b(self._testData[i][1]))
# Salt
test_salt = t2b(self._testData[i][3])
key._randfunc = lambda N: test_salt
# The real test
signer = PKCS.new(key)
self.assertTrue(signer.can_sign())
s = signer.sign(h)
self.assertEqual(s, t2b(self._testData[i][2]))
def testVerify1(self):
for i in range(len(self._testData)):
# Build the key
comps = [ long(rws(self._testData[i][0][x]),16) for x in ('n','e') ]
key = MyKey(RSA.construct(comps))
# Hash function
h = self._testData[i][4].new()
# Data to sign
h.update(t2b(self._testData[i][1]))
# Salt
test_salt = t2b(self._testData[i][3])
# The real test
key._randfunc = lambda N: test_salt
verifier = PKCS.new(key)
self.assertFalse(verifier.can_sign())
result = verifier.verify(h, t2b(self._testData[i][2]))
self.assertTrue(result)
def testSignVerify(self):
h = SHA.new()
h.update(b('blah blah blah'))
rng = Random.new().read
key = MyKey(RSA.generate(1024,rng))
# Helper function to monitor what's request from MGF
global mgfcalls
def newMGF(seed,maskLen):
global mgfcalls
mgfcalls += 1
return bchr(0x00)*maskLen
# Verify that PSS is friendly to all ciphers
for hashmod in (MD2,MD5,SHA,SHA224,SHA256,SHA384,RIPEMD):
h = hashmod.new()
h.update(b('blah blah blah'))
# Verify that sign() asks for as many random bytes
# as the hash output size
key.asked = 0
signer = PKCS.new(key)
s = signer.sign(h)
self.assertTrue(signer.verify(h, s))
self.assertEqual(key.asked, h.digest_size)
h = SHA.new()
h.update(b('blah blah blah'))
# Verify that sign() uses a different salt length
for sLen in (0,3,21):
key.asked = 0
signer = PKCS.new(key, saltLen=sLen)
s = signer.sign(h)
self.assertEqual(key.asked, sLen)
self.assertTrue(signer.verify(h, s))
# Verify that sign() uses the custom MGF
mgfcalls = 0
signer = PKCS.new(key, newMGF)
s = signer.sign(h)
self.assertEqual(mgfcalls, 1)
self.assertTrue(signer.verify(h, s))
# Verify that sign() does not call the RNG
# when salt length is 0, even when a new MGF is provided
key.asked = 0
mgfcalls = 0
signer = PKCS.new(key, newMGF, 0)
s = signer.sign(h)
self.assertEqual(key.asked,0)
self.assertEqual(mgfcalls, 1)
self.assertTrue(signer.verify(h, s))
def get_tests(config={}):
tests = []
tests += list_test_cases(PKCS1_PSS_Tests)
return tests
if __name__ == '__main__':
suite = lambda: unittest.TestSuite(get_tests())
unittest.main(defaultTest='suite')
# vim:set ts=4 sw=4 sts=4<|fim▁end|> | 57 7c 2e ea ff a2 0d 88 3a 76 e6 5e 39 4c 69 d4
b3 c0 5a 1e 8f ad da 27 ed b2 a4 2b c0 00 fe 88
8b 9b 32 c2 2d 15 ad d0 cd 76 b3 e7 93 6e 19 95 |
<|file_name|>glmnetPlot.py<|end_file_name|><|fim▁begin|># -*- coding: utf-8 -*-
"""
--------------------------------------------------------------------------
glmnetPlot.m: plot coefficients from a "glmnet" object
--------------------------------------------------------------------------
DESCRIPTION:
Produces a coefficient profile plot fo the coefficient paths for a
fitted "glmnet" object.
USAGE:
glmnetPlot(fit);
glmnetPlot(fit, xvar = 'norm');
glmnetPlot(fit, xvar = 'norm', label = False);
glmnetPlot(fit, xvar = 'norm', label = False, ptype = 'coef');
glmnetPlot(fit, xvar = 'norm', label = False, ptype = 'coef', ...);
INPUT ARGUMENTS:
x fitted "glmnet" model.
xvar What is on the X-axis. 'norm' plots against the L1-norm of
the coefficients, 'lambda' against the log-lambda sequence,
and 'dev' against the percent deviance explained.
label If true, label the curves with variable sequence numbers.
type If type='2norm' then a single curve per variable, else
if type='coef', a coefficient plot per response.
varargin Other graphical parameters to plot.
DETAILS:
A coefficient profile plot is produced. If x is a multinomial model, a
coefficient plot is produced for each class.
LICENSE:
GPL-2
AUTHORS:
Algorithm was designed by Jerome Friedman, Trevor Hastie and Rob Tibshirani
Fortran code was written by Jerome Friedman
R wrapper (from which the MATLAB wrapper was adapted) was written by Trevor Hasite
The original MATLAB wrapper was written by Hui Jiang,
and is updated and maintained by Junyang Qian.
This Python wrapper (adapted from the Matlab and R wrappers) is written by Balakumar B.J.,
Department of Statistics, Stanford University, Stanford, California, USA.
REFERENCES:
Friedman, J., Hastie, T. and Tibshirani, R. (2008) Regularization Paths for Generalized Linear Models via Coordinate Descent,
http://www.jstatsoft.org/v33/i01/
Journal of Statistical Software, Vol. 33(1), 1-22 Feb 2010
Simon, N., Friedman, J., Hastie, T., Tibshirani, R. (2011) Regularization Paths for Cox's Proportional Hazards Model via Coordinate Descent,
http://www.jstatsoft.org/v39/i05/
Journal of Statistical Software, Vol. 39(5) 1-13
Tibshirani, Robert., Bien, J., Friedman, J.,Hastie, T.,Simon, N.,Taylor, J. and Tibshirani, Ryan. (2010) Strong Rules for Discarding Predictors in Lasso-type Problems,
http://www-stat.stanford.edu/~tibs/ftp/strong.pdf
Stanford Statistics Technical Report
SEE ALSO:
glmnet, glmnetSet, glmnetPrint, glmnetPredict and glmnetCoef.
EXAMPLES:
import matplotlib.pyplot as plt
scipy.random.seed(1)
x=scipy.random.normal(size = (100,20))
y=scipy.random.normal(size = (100,1))
g4=scipy.random.choice(4,size = (100,1))*1.0
fit1=glmnet(x = x.copy(),y = y.copy())
glmnetPlot(fit1)
plt.figure()
glmnetPlot(fit1, 'lambda', True);
fit3=glmnet(x = x.copy(),y = g4.copy(), family = 'multinomial')
plt.figure()
glmnetPlot(fit3)
"""
import scipy
def glmnetPlot(x, xvar = 'norm', label = False, ptype = 'coef', **options):
import matplotlib.pyplot as plt
# process inputs
xvar = getFromList(xvar, ['norm', 'lambda', 'dev'], 'xvar should be one of ''norm'', ''lambda'', ''dev'' ')
ptype = getFromList(ptype, ['coef', '2norm'], 'ptype should be one of ''coef'', ''2norm'' ')
if x['class'] in ['elnet', 'lognet', 'coxnet', 'fishnet']:
handle = plotCoef(x['beta'], [], x['lambdau'], x['df'], x['dev'],
label, xvar, '', 'Coefficients', **options)
elif x['class'] in ['multnet', 'mrelnet']:
beta = x['beta']
if xvar == 'norm':
norm = 0
nzbeta = beta
for i in range(len(beta)):
which = nonzeroCoef(beta[i])
nzbeta[i] = beta[i][which, :]
norm = norm + scipy.sum(scipy.absolute(nzbeta[i]), axis = 0)
else:
norm = 0
if ptype == 'coef':
ncl = x['dfmat'].shape[0]
if x['class'] == 'multnet':
for i in range(ncl):
mstr = 'Coefficients: Class %d' % (i)
handle = plotCoef(beta[i], norm, x['lambdau'], x['dfmat'][i,:],
x['dev'], label, xvar, '', mstr, **options)
if i < ncl - 1:
plt.figure()
else:
for i in range(ncl):
mstr = 'Coefficients: Response %d' % (i)
handle = plotCoef(beta[i], norm, x['lambdau'], x['dfmat'][i,:],
x['dev'], label, xvar, '', mstr, **options)
if i < ncl - 1:
plt.figure()
else:
dfseq = scipy.round_(scipy.mean(x['dfmat'], axis = 0))
coefnorm = beta[1]*0
for i in range(len(beta)):
coefnorm = coefnorm + scipy.absolute(beta[i])**2
coefnorm = scipy.sqrt(coefnorm)
if x['class'] == 'multnet':
mstr = 'Coefficient 2Norms'
handle = plotCoef(coefnorm, norm, x['lambdau'], dfseq, x['dev'],
label, xvar, '',mstr, **options);
else:
mstr = 'Coefficient 2Norms'
handle = plotCoef(coefnorm, norm, x['lambdau'], x['dfmat'][0,:], x['dev'],
label, xvar, '', mstr, **options);
return(handle)
# end of glmnetplot
# =========================================
#
# =========================================
# helper functions
# =========================================
def getFromList(xvar, xvarbase, errMsg):
indxtf = [x.startswith(xvar.lower()) for x in xvarbase] # find index
xvarind = [i for i in range(len(indxtf)) if indxtf[i] == True]
if len(xvarind) == 0:
raise ValueError(errMsg)
else:
xvar = xvarbase[xvarind[0]]
return xvar
# end of getFromList()
# =========================================
def nonzeroCoef(beta, bystep = False):
result = scipy.absolute(beta) > 0
if len(result.shape) == 1:
result = scipy.reshape(result, [result.shape[0], 1])
if not bystep:
result = scipy.any(result, axis = 1)
return(result)
# end of nonzeroCoef()
# =========================================
def plotCoef(beta, norm, lambdau, df, dev, label, xvar, xlab, ylab, **options):
import matplotlib.pyplot as plt
which = nonzeroCoef(beta)
idwhich = [i for i in range(len(which)) if which[i] == True]
nwhich = len(idwhich)
if nwhich == 0:
raise ValueError('No plot produced since all coefficients are zero')
elif nwhich == 1:
raise ValueError('1 or less nonzero coefficients; glmnet plot is not meaningful')
beta = beta[which, :]
if xvar == 'norm':
if len(norm) == 0:
index = scipy.sum(scipy.absolute(beta), axis = 0)<|fim▁hole|> elif xvar == 'lambda':
index = scipy.log(lambdau)
iname = 'Log Lambda'
elif xvar == 'dev':
index = dev
iname = 'Fraction Deviance Explained'
if len(xlab) == 0:
xlab = iname
# draw the figures
#fig, ax1 = plt.subplots()
fig = plt.gcf()
ax1 = plt.gca()
# plot x vs y
beta = scipy.transpose(beta)
ax1.plot(index, beta, **options)
ax2 = ax1.twiny()
ax2.xaxis.tick_top()
xlim1 = ax1.get_xlim()
ylim1 = ax1.get_ylim()
atdf = ax1.get_xticks()
indat = scipy.ones(atdf.shape, dtype = scipy.integer)
if index[-1] >= index[1]:
for j in range(len(index)-1, -1, -1):
indat[atdf <= index[j]] = j
else:
for j in range(len(index)):
indat[atdf <= index[j]] = j
prettydf = df[indat]
prettydf[-1] = df[-1]
ax2.set(XLim=[min(index), max(index)], XTicks = atdf, XTickLabels = prettydf)
ax2.grid()
ax1.yaxis.grid()
ax2.set_xlabel('Degrees of Freedom')
ax1.set_xlabel(xlab)
ax1.set_ylabel(ylab)
# put the labels
if label:
xpos = max(index)
adjpos = 1
if xvar == 'lambda':
xpos = min(index)
adjpos = 0
bsize = beta.shape
for i in range(beta.shape[1]):
str = '%d' % idwhich[i]
ax1.text(1/2*xpos + 1/2*xlim1[adjpos], beta[bsize[0]-1, i], str)
plt.show()
handle = dict()
handle['fig'] = fig
handle['ax1'] = ax1
handle['ax2'] = ax2
return(handle)
# end of plotCoef
# =========================================<|fim▁end|> | else:
index = norm
iname = 'L1 Norm' |
<|file_name|>test_nixie_errors.py<|end_file_name|><|fim▁begin|>import unittest, uuid
from nixie.core import Nixie, KeyError
class NixieErrorsTestCase(unittest.TestCase):
def test_read_missing(self):
nx = Nixie()
self.assertIsNone(nx.read('missing'))
def test_update_missing(self):
nx = Nixie()
with self.assertRaises(KeyError):
nx.update('missing')<|fim▁hole|> def test_update_with_wrong_value(self):
nx = Nixie()
key = nx.create()
with self.assertRaises(ValueError):
nx.update(key, 'a')
def test_delete_missing(self):
nx = Nixie()
with self.assertRaises(KeyError):
nx.delete('missing')<|fim▁end|> | |
<|file_name|>PermissionsDeploymentTestCase.java<|end_file_name|><|fim▁begin|>/*
* JBoss, Home of Professional Open Source.
* Copyright 2012, Red Hat, Inc., and individual contributors
* as indicated by the @author tags. See the copyright.txt file in the
* distribution for a full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*
*/
package org.jboss.as.test.manualmode.secman;
import org.jboss.as.controller.PathAddress;
import org.jboss.as.controller.client.ModelControllerClient;
import org.jboss.as.controller.descriptions.ModelDescriptionConstants;
import org.jboss.as.test.manualmode.deployment.AbstractDeploymentScannerBasedTestCase;
import org.jboss.as.test.shared.TestSuiteEnvironment;
import org.jboss.as.test.shared.TimeoutUtil;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.StringAsset;
import org.jboss.shrinkwrap.api.exporter.ZipExporter;
import org.jboss.shrinkwrap.api.spec.JavaArchive;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.wildfly.core.testrunner.ServerControl;
import org.wildfly.core.testrunner.ServerController;
import org.wildfly.core.testrunner.WildflyTestRunner;
import javax.inject.Inject;
import java.io.File;
/**
* Tests the processing of {@code permissions.xml} in deployments
*
* @author Jaikiran Pai
*/
@RunWith(WildflyTestRunner.class)
@ServerControl(manual = true)
public class PermissionsDeploymentTestCase extends AbstractDeploymentScannerBasedTestCase {
private static final String SYS_PROP_SERVER_BOOTSTRAP_MAX_THREADS = "-Dorg.jboss.server.bootstrap.maxThreads=1";
@Rule
public TemporaryFolder tempDir = new TemporaryFolder();
@Inject
private ServerController container;
private ModelControllerClient modelControllerClient;
@Before
public void before() throws Exception {
modelControllerClient = TestSuiteEnvironment.getModelControllerClient();
}
@After
public void after() throws Exception {
modelControllerClient.close();
}
@Override
protected File getDeployDir() {
return this.tempDir.getRoot();
}
/**
* Tests that when the server is booted with {@code org.jboss.server.bootstrap.maxThreads} system property
* set (to whatever value), the deployment unit processors relevant for dealing with processing of {@code permissions.xml},
* in deployments, do run and process the deployment
* <p>
* NOTE: This test just tests that the deployment unit processor(s) process the deployment unit for the {@code permissions.xml}
* and it's not in the scope of this test to verify that the permissions configured in that file are indeed applied correctly
* to the deployment unit
*
* @throws Exception
* @see <a href="https://issues.jboss.org/browse/WFLY-6657">WFLY-6657</a>
*/
@Test
public void testWithConfiguredMaxBootThreads() throws Exception {
// Test-runner's ServerController/Server uses prop jvm.args to control what args are passed
// to the server process VM. So, we add the system property controlling the max boot threads,
// here
final String existingJvmArgs = System.getProperty("jvm.args");
if (existingJvmArgs == null) {
System.setProperty("jvm.args", SYS_PROP_SERVER_BOOTSTRAP_MAX_THREADS);
} else {
System.setProperty("jvm.args", existingJvmArgs + " " + SYS_PROP_SERVER_BOOTSTRAP_MAX_THREADS);
}
// start the container
container.start();
try {
addDeploymentScanner(modelControllerClient,1000, false, true);
this.testInvalidPermissionsXmlDeployment("test-permissions-xml-with-configured-max-boot-threads.jar");
} finally {
removeDeploymentScanner(modelControllerClient);
container.stop();
if (existingJvmArgs == null) {
System.clearProperty("jvm.args");
} else {
System.setProperty("jvm.args", existingJvmArgs);
}
}
}
/**
* Tests that when the server is booted *without* the {@code org.jboss.server.bootstrap.maxThreads} system property
* set, the deployment unit processors relevant for dealing with processing of {@code permissions.xml},
* in deployments, do run and process the deployment
* <p>
* NOTE: This test just tests that the deployment unit processor(s) process the deployment unit for the {@code permissions.xml}
* and it's not in the scope of this test to verify that the permissions configured in that file are indeed applied correctly
* to the deployment unit
*
* @throws Exception<|fim▁hole|> container.start();
try {
addDeploymentScanner(modelControllerClient,1000, false, true);
this.testInvalidPermissionsXmlDeployment("test-permissions-xml-without-max-boot-threads.jar");
} finally {
removeDeploymentScanner(modelControllerClient);
container.stop();
}
}
private void testInvalidPermissionsXmlDeployment(final String deploymentName) throws Exception {
final JavaArchive jar = ShrinkWrap.create(JavaArchive.class);
// add an empty (a.k.a invalid content) in permissions.xml
jar.addAsManifestResource(new StringAsset(""), "permissions.xml");
// "deploy" it by placing it in the deployment directory
jar.as(ZipExporter.class).exportTo(new File(getDeployDir(), deploymentName));
final PathAddress deploymentPathAddr = PathAddress.pathAddress(ModelDescriptionConstants.DEPLOYMENT, deploymentName);
// wait for the deployment to be picked up and completed (either with success or failure)
waitForDeploymentToFinish(deploymentPathAddr);
// the deployment is expected to fail due to a parsing error in the permissions.xml
Assert.assertEquals("Deployment was expected to fail", "FAILED", deploymentState(modelControllerClient, deploymentPathAddr));
}
private void waitForDeploymentToFinish(final PathAddress deploymentPathAddr) throws Exception {
// Wait until deployed ...
long timeout = System.currentTimeMillis() + TimeoutUtil.adjust(30000);
while (!exists(modelControllerClient, deploymentPathAddr) && System.currentTimeMillis() < timeout) {
Thread.sleep(100);
}
Assert.assertTrue(exists(modelControllerClient, deploymentPathAddr));
}
}<|fim▁end|> | * @see <a href="https://issues.jboss.org/browse/WFLY-6657">WFLY-6657</a>
*/
@Test
public void testWithoutConfiguredMaxBootThreads() throws Exception { |
<|file_name|>benchmark.cpp<|end_file_name|><|fim▁begin|>/**
* @license Apache-2.0
*
* Copyright (c) 2022 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Benchmark Boost `TODO`.
*/
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <sys/time.h>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include <boost/TODO/TODO.hpp>
using boost::random::uniform_real_distribution;
using boost::random::mt19937;
#define NAME "TODO"
#define ITERATIONS 1000000
#define REPEATS 3
/**
* Prints the TAP version.
*/
void print_version() {
printf( "TAP version 13\n" );
}
/**
* Prints the TAP summary.
*
* @param total total number of tests
* @param passing total number of passing tests
*/
void print_summary( int total, int passing ) {
printf( "#\n" );
printf( "1..%d\n", total ); // TAP plan
printf( "# total %d\n", total );
printf( "# pass %d\n", passing );
printf( "#\n" );
printf( "# ok\n" );<|fim▁hole|>
/**
* Prints benchmarks results.
*
* @param elapsed elapsed time in seconds
*/
void print_results( double elapsed ) {
double rate = (double)ITERATIONS / elapsed;
printf( " ---\n" );
printf( " iterations: %d\n", ITERATIONS );
printf( " elapsed: %0.9f\n", elapsed );
printf( " rate: %0.9f\n", rate );
printf( " ...\n" );
}
/**
* Returns a clock time.
*
* @return clock time
*/
double tic() {
struct timeval now;
gettimeofday( &now, NULL );
return (double)now.tv_sec + (double)now.tv_usec/1.0e6;
}
/**
* Runs a benchmark.
*
* @return elapsed time in seconds
*/
double benchmark() {
double elapsed;
double x;
double y;
double t;
int i;
// Define a new pseudorandom number generator:
mt19937 rng;
// Define a uniform distribution for generating pseudorandom numbers as "doubles" between a minimum value (inclusive) and a maximum value (exclusive):
uniform_real_distribution<> randu( 0.0, 1.0 );
t = tic();
for ( i = 0; i < ITERATIONS; i++ ) {
x = randu( rng );
y = 0.0; // TODO
if ( y != y ) {
printf( "should not return NaN\n" );
break;
}
}
elapsed = tic() - t;
if ( y != y ) {
printf( "should not return NaN\n" );
}
return elapsed;
}
/**
* Main execution sequence.
*/
int main( void ) {
double elapsed;
int i;
print_version();
for ( i = 0; i < REPEATS; i++ ) {
printf( "# cpp::boost::%s\n", NAME );
elapsed = benchmark();
print_results( elapsed );
printf( "ok %d benchmark finished\n", i+1 );
}
print_summary( REPEATS, REPEATS );
return 0;
}<|fim▁end|> | } |
<|file_name|>AV Rule 78.cpp<|end_file_name|><|fim▁begin|>class Base {
public:
Resource *p;
Base() {
p = createResource();
}
virtual void f() { //has virtual function
//...
}
//...
~Base() { //wrong: is non-virtual
freeResource(p);
}
};
class Derived: public Base {
public:
Resource *dp;
Derived() {
dp = createResource2();
}
~Derived() {
freeResource2(dp);
}
};
int f() {
Base *b = new Derived(); //creates resources for both Base::p and Derived::dp<|fim▁hole|> //...
//will only call Base::~Base(), leaking the resource dp.
//Change both destructors to virtual to ensure they are both called.
delete b;
}<|fim▁end|> | |
<|file_name|>tests.py<|end_file_name|><|fim▁begin|>from __future__ import division, print_function
import unittest
import inspect
import sympy
from sympy import symbols
import numpy as np
from symfit.api import Variable, Parameter, Fit, FitResults, Maximize, Minimize, exp, Likelihood, ln, log, variables, parameters
from symfit.functions import Gaussian, Exp
import scipy.stats
from scipy.optimize import curve_fit
from symfit.core.support import sympy_to_scipy, sympy_to_py
import matplotlib.pyplot as plt
import seaborn
class TddInPythonExample(unittest.TestCase):
def test_gaussian(self):
x0, sig = parameters('x0, sig')
x = Variable()
new = sympy.exp(-(x - x0)**2/(2*sig**2))
self.assertIsInstance(new, sympy.exp)
g = Gaussian(x, x0, sig)
self.assertTrue(issubclass(g.__class__, sympy.exp))
def test_callable(self):
a, b = parameters('a, b')
x, y = variables('x, y')
func = a*x**2 + b*y**2
result = func(x=2, y=3, a=3, b=9)
self.assertEqual(result, 3*2**2 + 9*3**2)
xdata = np.arange(1,10)
ydata = np.arange(1,10)
result = func(x=ydata, y=ydata, a=3, b=9)
self.assertTrue(np.array_equal(result, 3*xdata**2 + 9*ydata**2))
def test_read_only_results(self):
"""
Fit results should be read-only. Let's try to break this!
"""
xdata = np.linspace(1,10,10)
ydata = 3*xdata**2
a = Parameter(3.0, min=2.75)
b = Parameter(2.0, max=2.75)
x = Variable('x')
new = a*x**b
fit = Fit(new, xdata, ydata)
fit_result = fit.execute()
# Break it!
try:
fit_result.params = 'hello'
except AttributeError:
self.assertTrue(True) # desired result
else:
self.assertNotEqual(fit_result.params, 'hello')
try:
# Bypass the property getter. This will work, as it set's the instance value of __params.
fit_result.__params = 'hello'
except AttributeError as foo:
self.assertTrue(False) # undesired result
else:
self.assertNotEqual(fit_result.params, 'hello')
# The assginment will have succeeded on the instance because we set it from the outside.
# I must admit I don't fully understand why this is allowed and I don't like it.
# However, the tests below show that it did not influence the class method itself so
# fitting still works fine.
self.assertEqual(fit_result.__params, 'hello')
# Do a second fit and dubble check that we do not overwrtie something crusial.
xdata = np.arange(-5, 5, 1)
ydata = np.arange(-5, 5, 1)
xx, yy = np.meshgrid(xdata, ydata, sparse=False)
xdata_coor = np.dstack((xx, yy))
zdata = (2.5*xx**2 + 3.0*yy**2)
a = Parameter(2.5, max=2.75)
b = Parameter(3.0, min=2.75)
x = Variable()
y = Variable()
new = (a*x**2 + b*y**2)
fit_2 = Fit(new, xdata_coor, zdata)
fit_result_2 = fit_2.execute()
self.assertNotAlmostEqual(fit_result.params.a, fit_result_2.params.a)
self.assertAlmostEqual(fit_result.params.a, 3.0)
self.assertAlmostEqual(fit_result_2.params.a, 2.5)
self.assertNotAlmostEqual(fit_result.params.b, fit_result_2.params.b)
self.assertAlmostEqual(fit_result.params.b, 2.0)
self.assertAlmostEqual(fit_result_2.params.b, 3.0)
def test_fitting(self):
xdata = np.linspace(1,10,10)
ydata = 3*xdata**2
a = Parameter(3.0)
b = Parameter(2.0)
x = Variable('x')
new = a*x**b
fit = Fit(new, xdata, ydata)
func = sympy_to_py(new, [x], [a, b])
result = func(xdata, 3, 2)
self.assertTrue(np.array_equal(result, ydata))
result = fit.scipy_func(fit.xdata, [3, 2])
self.assertTrue(np.array_equal(result, ydata))
args, varargs, keywords, defaults = inspect.getargspec(func)
# self.assertEqual(args, ['x', 'a', 'b'])
fit_result = fit.execute()
self.assertIsInstance(fit_result, FitResults)
self.assertAlmostEqual(fit_result.params.a, 3.0)
self.assertAlmostEqual(fit_result.params.b, 2.0)
self.assertIsInstance(fit_result.params.a_stdev, float)
self.assertIsInstance(fit_result.params.b_stdev, float)
self.assertIsInstance(fit_result.r_squared, float)
# Test several false ways to access the data.
self.assertRaises(AttributeError, getattr, *[fit_result.params, 'a_fdska'])
self.assertRaises(AttributeError, getattr, *[fit_result.params, 'c'])
self.assertRaises(AttributeError, getattr, *[fit_result.params, 'a_stdev_stdev'])
self.assertRaises(AttributeError, getattr, *[fit_result.params, 'a_stdev_'])
self.assertRaises(AttributeError, getattr, *[fit_result.params, 'a__stdev'])
def test_numpy_functions(self):
xdata = np.linspace(1,10,10)
ydata = 45*np.log(xdata*2)
a = Parameter()
b = Parameter(value=2.1, fixed=True)
x = Variable()
new = a*sympy.log(x*b)
def test_grid_fitting(self):
xdata = np.arange(-5, 5, 1)
ydata = np.arange(-5, 5, 1)
xx, yy = np.meshgrid(xdata, ydata, sparse=False)
xdata_coor = np.dstack((xx, yy))
zdata = (2.5*xx**2 + 3.0*yy**2)
a = Parameter(2.5, max=2.75)
b = Parameter(3.0, min=2.75)
x = Variable()
y = Variable()
new = (a*x**2 + b*y**2)
fit = Fit(new, xdata_coor, zdata)
# Test the flatten function for consistency.
xdata_coor_flat, zdata_flat = fit._flatten(xdata_coor, zdata)
# _flatten transposes such arrays because the variables are in the deepest dimension instead of the first.
# This is normally not a problem because all we want from the fit is the correct parameters.
self.assertFalse(np.array_equal(zdata, zdata_flat.reshape((10,10))))
self.assertTrue(np.array_equal(zdata, zdata_flat.reshape((10,10)).T))
self.assertFalse(np.array_equal(xdata_coor, xdata_coor_flat.reshape((10,10,2))))
new_xdata = xdata_coor_flat.reshape((2,10,10)).T
self.assertTrue(np.array_equal(xdata_coor, new_xdata))
results = fit.execute()
self.assertAlmostEqual(results.params.a, 2.5)
self.assertAlmostEqual(results.params.b, 3.)
def test_2D_fitting(self):
xdata = np.random.randint(-10, 11, size=(2, 400))
zdata = 2.5*xdata[0]**2 + 7.0*xdata[1]**2
a = Parameter()
b = Parameter()
x = Variable()
y = Variable()
new = a*x**2 + b*y**2
fit = Fit(new, xdata, zdata)
result = fit.scipy_func(fit.xdata, [2, 3])
import inspect
args, varargs, keywords, defaults = inspect.getargspec(fit.scipy_func)
self.assertEqual(args, ['x', 'p'])
fit_result = fit.execute()
self.assertIsInstance(fit_result, FitResults)
def test_gaussian_fitting(self):
xdata = 2*np.random.rand(10000) - 1 # random betwen [-1, 1]
ydata = scipy.stats.norm.pdf(xdata, loc=0.0, scale=1.0)
x0 = Parameter()
sig = Parameter()
A = Parameter()
x = Variable()
g = A * Gaussian(x, x0, sig)
fit = Fit(g, xdata, ydata)
fit_result = fit.execute()
self.assertAlmostEqual(fit_result.params.A, 0.3989423)
self.assertAlmostEqual(np.abs(fit_result.params.sig), 1.0)
self.assertAlmostEqual(fit_result.params.x0, 0.0)
# raise Exception([i for i in fit_result.params])
sexy = g(x=2.0, **fit_result.params)
ugly = g(
x=2.0,
x0=fit_result.params.x0,
A=fit_result.params.A,
sig=fit_result.params.sig,
)
self.assertEqual(sexy, ugly)
def test_2_gaussian_2d_fitting(self):
np.random.seed(4242)
mean = (0.3, 0.3) # x, y mean 0.6, 0.4
cov = [[0.01**2,0],[0,0.01**2]]
data = np.random.multivariate_normal(mean, cov, 1000000)
mean = (0.7,0.7) # x, y mean 0.6, 0.4
cov = [[0.01**2,0],[0,0.01**2]]
data_2 = np.random.multivariate_normal(mean, cov, 1000000)
data = np.vstack((data, data_2))
# Insert them as y,x here as np fucks up cartesian conventions.
ydata, xedges, yedges = np.histogram2d(data[:,1], data[:,0], bins=100, range=[[0.0, 1.0], [0.0, 1.0]])
xcentres = (xedges[:-1] + xedges[1:]) / 2
ycentres = (yedges[:-1] + yedges[1:]) / 2
# Make a valid grid to match ydata
xx, yy = np.meshgrid(xcentres, ycentres, sparse=False)
xdata = np.dstack((xx, yy)).T
x = Variable()
y = Variable()
x0_1 = Parameter(0.7, min=0.6, max=0.8)
sig_x_1 = Parameter(0.1, min=0.0, max=0.2)<|fim▁hole|>
x0_2 = Parameter(0.3, min=0.2, max=0.4)
sig_x_2 = Parameter(0.1, min=0.0, max=0.2)
y0_2 = Parameter(0.3, min=0.2, max=0.4)
sig_y_2 = Parameter(0.1, min=0.0, max=0.2)
A_2 = Parameter()
g_2 = A_2 * Gaussian(x, x0_2, sig_x_2) * Gaussian(y, y0_2, sig_y_2)
model = g_1 + g_2
fit = Fit(model, xdata, ydata)
fit_result = fit.execute()
img = model(x=xx, y=yy, **fit_result.params)
img_g_1 = g_1(x=xx, y=yy, **fit_result.params)
# Equal up to some precision. Not much obviously.
self.assertAlmostEqual(fit_result.params.x0_1, 0.7, 2)
self.assertAlmostEqual(fit_result.params.y0_1, 0.7, 2)
self.assertAlmostEqual(fit_result.params.x0_2, 0.3, 2)
self.assertAlmostEqual(fit_result.params.y0_2, 0.3, 2)
def test_gaussian_2d_fitting(self):
mean = (0.6,0.4) # x, y mean 0.6, 0.4
cov = [[0.2**2,0],[0,0.1**2]]
data = np.random.multivariate_normal(mean, cov, 1000000)
# Insert them as y,x here as np fucks up cartesian conventions.
ydata, xedges, yedges = np.histogram2d(data[:,0], data[:,1], bins=100, range=[[0.0, 1.0], [0.0, 1.0]])
xcentres = (xedges[:-1] + xedges[1:]) / 2
ycentres = (yedges[:-1] + yedges[1:]) / 2
# Make a valid grid to match ydata
xx, yy = np.meshgrid(xcentres, ycentres, sparse=False)
xdata = np.dstack((xx, yy)).T # T because np fucks up conventions.
x0 = Parameter(0.6)
sig_x = Parameter(0.2, min=0.0)
x = Variable()
y0 = Parameter(0.4)
sig_y = Parameter(0.1, min=0.0)
A = Parameter()
y = Variable()
g = A * Gaussian(x, x0, sig_x) * Gaussian(y, y0, sig_y)
fit = Fit(g, xdata, ydata)
fit_result = fit.execute()
# Again, the order seems to be swapped for py3k
self.assertAlmostEqual(fit_result.params.x0, np.mean(data[:,0]), 3)
self.assertAlmostEqual(fit_result.params.y0, np.mean(data[:,1]), 3)
self.assertAlmostEqual(np.abs(fit_result.params.sig_x), np.std(data[:,0]), 3)
self.assertAlmostEqual(np.abs(fit_result.params.sig_y), np.std(data[:,1]), 3)
self.assertGreaterEqual(fit_result.r_squared, 0.99)
def test_minimize(self):
x = Parameter(-1.)
y = Parameter()
model = 2*x*y + 2*x - x**2 - 2*y**2
from sympy import Eq, Ge
constraints = [
Ge(y - 1, 0), #y - 1 >= 0,
Eq(x**3 - y, 0), # x**3 - y == 0,
]
# raise Exception(model.atoms(), model.as_ordered_terms())
# self.assertIsInstance(constraints[0], Eq)
# Unbounded
fit = Maximize(model)
fit_result = fit.execute()
self.assertAlmostEqual(fit_result.params.y, 1.)
self.assertAlmostEqual(fit_result.params.x, 2.)
fit = Maximize(model, constraints=constraints)
fit_result = fit.execute()
self.assertAlmostEqual(fit_result.params.x, 1.00000009)
self.assertAlmostEqual(fit_result.params.y, 1.)
def test_scipy_style(self):
def func(x, sign=1.0):
""" Objective function """
return sign*(2*x[0]*x[1] + 2*x[0] - x[0]**2 - 2*x[1]**2)
def func_deriv(x, sign=1.0):
""" Derivative of objective function """
dfdx0 = sign*(-2*x[0] + 2*x[1] + 2)
dfdx1 = sign*(2*x[0] - 4*x[1])
return np.array([ dfdx0, dfdx1 ])
cons = (
{'type': 'eq',
'fun' : lambda x: np.array([x[0]**3 - x[1]]),
'jac' : lambda x: np.array([3.0*(x[0]**2.0), -1.0])},
{'type': 'ineq',
'fun' : lambda x: np.array([x[1] - 1]),
'jac' : lambda x: np.array([0.0, 1.0])})
from scipy.optimize import minimize
res = minimize(func, [-1.0,1.0], args=(-1.0,), jac=func_deriv,
method='SLSQP', options={'disp': True})
res = minimize(func, [-1.0,1.0], args=(-1.0,), jac=func_deriv,
constraints=cons, method='SLSQP', options={'disp': True})
def test_likelihood_fitting(self):
"""
Fit using the likelihood method.
"""
b = Parameter(4, min=3.0)
x = Variable()
pdf = (1/b) * exp(- x / b)
# Draw 100 points from an exponential distribution.
# np.random.seed(100)
xdata = np.random.exponential(5, 100000)
fit = Likelihood(pdf, xdata)
fit_result = fit.execute()
self.assertAlmostEqual(fit_result.params.b, 5., 1)
def test_parameter_add(self):
a = Parameter(value=1.0, min=0.5, max=1.5)
b = Parameter(1.0, min=0.0)
new = a + b
self.assertIsInstance(new, sympy.Add)
def test_argument_name(self):
a = Parameter()
b = Parameter(name='b')
c = Parameter(name='d')
self.assertEqual(a.name, 'a')
self.assertEqual(b.name, 'b')
self.assertEqual(c.name, 'd')
def test_symbol_add(self):
x, y = symbols('x y')
new = x + y
self.assertIsInstance(new, sympy.Add)
def test_evaluate_model(self):
A = Parameter()
x = Variable()
new = A * x ** 2
self.assertEqual(new(x=2, A=2), 8)
self.assertNotEqual(new(x=2, A=3), 8)
def test_symbol_object_add(self):
from sympy.core.symbol import Symbol
x = Symbol('x')
y = Symbol('y')
new = x + y
self.assertIsInstance(new, sympy.Add)
def test_simple_sigma(self):
from symfit.api import Variable, Parameter, Fit
t_data = np.array([1.4, 2.1, 2.6, 3.0, 3.3])
y_data = np.array([10, 20, 30, 40, 50])
sigma = 0.2
n = np.array([5, 3, 8, 15, 30])
sigma_t = sigma / np.sqrt(n)
# We now define our model
y = Variable()
g = Parameter()
t_model = (2 * y / g)**0.5
fit = Fit(t_model, y_data, t_data)#, sigma=sigma_t)
fit_result = fit.execute()
# h_smooth = np.linspace(0,60,100)
# t_smooth = t_model(y=h_smooth, **fit_result.params)
# Lets with the results from curve_fit, no weights
popt_noweights, pcov_noweights = curve_fit(lambda y, p: (2 * y / p)**0.5, y_data, t_data)
self.assertAlmostEqual(fit_result.params.g, popt_noweights[0])
self.assertAlmostEqual(fit_result.params.g_stdev, np.sqrt(pcov_noweights[0, 0]))
# Same sigma everywere
fit = Fit(t_model, y_data, t_data, sigma=0.0031, absolute_sigma=False)
fit_result = fit.execute()
popt_sameweights, pcov_sameweights = curve_fit(lambda y, p: (2 * y / p)**0.5, y_data, t_data, sigma=0.0031, absolute_sigma=False)
self.assertAlmostEqual(fit_result.params.g, popt_sameweights[0], 4)
self.assertAlmostEqual(fit_result.params.g_stdev, np.sqrt(pcov_sameweights[0, 0]), 4)
# Same weight everywere should be the same as no weight.
self.assertAlmostEqual(fit_result.params.g, popt_noweights[0], 4)
self.assertAlmostEqual(fit_result.params.g_stdev, np.sqrt(pcov_noweights[0, 0]), 4)
# Different sigma for every point
fit = Fit(t_model, y_data, t_data, sigma=0.1*sigma_t, absolute_sigma=False)
fit_result = fit.execute()
popt, pcov = curve_fit(lambda y, p: (2 * y / p)**0.5, y_data, t_data, sigma=.1*sigma_t)
self.assertAlmostEqual(fit_result.params.g, popt[0])
self.assertAlmostEqual(fit_result.params.g_stdev, np.sqrt(pcov[0, 0]))
self.assertAlmostEqual(fit_result.params.g, 9.095, 3)
self.assertAlmostEqual(fit_result.params.g_stdev, 0.102, 3) # according to Mathematica
def test_error_advanced(self):
"""
Models an example from the mathematica docs and try's to replicate it:
http://reference.wolfram.com/language/howto/FitModelsWithMeasurementErrors.html
"""
data = [
[0.9, 6.1, 9.5], [3.9, 6., 9.7], [0.3, 2.8, 6.6],
[1., 2.2, 5.9], [1.8, 2.4, 7.2], [9., 1.7, 7.],
[7.9, 8., 10.4], [4.9, 3.9, 9.], [2.3, 2.6, 7.4],
[4.7, 8.4, 10.]
]
x, y, z = zip(*data)
xy = np.vstack((x, y))
z = np.array(z)
errors = np.array([.4, .4, .2, .4, .1, .3, .1, .2, .2, .2])
# raise Exception(xy, z)
a = Parameter()
b = Parameter(0.9)
c = Parameter(5)
x = Variable()
y = Variable()
model = a * log(b * x + c * y)
fit = Fit(model, xy, z, absolute_sigma=False)
fit_result = fit.execute()
print(fit_result)
# Same as Mathematica default behavior.
self.assertAlmostEqual(fit_result.params.a, 2.9956, 4)
self.assertAlmostEqual(fit_result.params.b, 0.563212, 4)
self.assertAlmostEqual(fit_result.params.c, 3.59732, 4)
self.assertAlmostEqual(fit_result.params.a_stdev, 0.278304, 4)
self.assertAlmostEqual(fit_result.params.b_stdev, 0.224107, 4)
self.assertAlmostEqual(fit_result.params.c_stdev, 0.980352, 4)
fit = Fit(model, xy, z, absolute_sigma=True)
fit_result = fit.execute()
# Same as Mathematica in Measurement error mode, but without suplying
# any errors.
self.assertAlmostEqual(fit_result.params.a, 2.9956, 4)
self.assertAlmostEqual(fit_result.params.b, 0.563212, 4)
self.assertAlmostEqual(fit_result.params.c, 3.59732, 4)
self.assertAlmostEqual(fit_result.params.a_stdev, 0.643259, 4)
self.assertAlmostEqual(fit_result.params.b_stdev, 0.517992, 4)
self.assertAlmostEqual(fit_result.params.c_stdev, 2.26594, 4)
fit = Fit(model, xy, z, sigma=errors)
fit_result = fit.execute()
popt, pcov, infodict, errmsg, ier = curve_fit(lambda x_vec, a, b, c: a * np.log(b * x_vec[0] + c * x_vec[1]), xy, z, sigma=errors, absolute_sigma=True, full_output=True)
# Same as curve_fit?
self.assertAlmostEqual(fit_result.params.a, popt[0], 4)
self.assertAlmostEqual(fit_result.params.b, popt[1], 4)
self.assertAlmostEqual(fit_result.params.c, popt[2], 4)
self.assertAlmostEqual(fit_result.params.a_stdev, np.sqrt(pcov[0,0]), 4)
self.assertAlmostEqual(fit_result.params.b_stdev, np.sqrt(pcov[1,1]), 4)
self.assertAlmostEqual(fit_result.params.c_stdev, np.sqrt(pcov[2,2]), 4)
# Same as Mathematica with MEASUREMENT ERROR
self.assertAlmostEqual(fit_result.params.a, 2.68807, 4)
self.assertAlmostEqual(fit_result.params.b, 0.941344, 4)
self.assertAlmostEqual(fit_result.params.c, 5.01541, 4)
self.assertAlmostEqual(fit_result.params.a_stdev, 0.0974628, 4)
self.assertAlmostEqual(fit_result.params.b_stdev, 0.247018, 4)
self.assertAlmostEqual(fit_result.params.c_stdev, 0.597661, 4)
def test_error_analytical(self):
"""
Test using a case where the analytical answer is known.
Modeled after:
http://nbviewer.ipython.org/urls/gist.github.com/taldcroft/5014170/raw/31e29e235407e4913dc0ec403af7ed524372b612/curve_fit.ipynb
"""
N = 10000
sigma = 10
xn = np.arange(N, dtype=np.float)
yn = np.zeros_like(xn)
yn = yn + np.random.normal(size=len(yn), scale=sigma)
a = Parameter()
model = a
fit = Fit(model, xn, yn, sigma=sigma)
fit_result = fit.execute()
popt, pcov = curve_fit(lambda x, a: a * np.ones_like(x), xn, yn, sigma=sigma, absolute_sigma=True)
self.assertAlmostEqual(fit_result.params.a, popt[0], 5)
self.assertAlmostEqual(fit_result.params.a_stdev, np.sqrt(np.diag(pcov))[0], 2)
fit_no_sigma = Fit(model, xn, yn)
fit_result_no_sigma = fit_no_sigma.execute()
popt, pcov = curve_fit(lambda x, a: a * np.ones_like(x), xn, yn,)
# With or without sigma, the bestfit params should be in agreement in case of equal weights
self.assertAlmostEqual(fit_result.params.a, fit_result_no_sigma.params.a, 5)
# Since symfit is all about absolute errors, the sigma will not be in agreement
self.assertNotEqual(fit_result.params.a_stdev, fit_result_no_sigma.params.a_stdev, 5)
self.assertAlmostEqual(fit_result_no_sigma.params.a, popt[0], 5)
self.assertAlmostEqual(fit_result_no_sigma.params.a_stdev, pcov[0][0]**0.5, 5)
# Analytical answer for mean of N(0,1):
mu = 0.0
sigma_mu = sigma/N**0.5
# self.assertAlmostEqual(fit_result.params.a, mu, 5)
self.assertAlmostEqual(fit_result.params.a_stdev, sigma_mu, 5)
def test_straight_line_analytical(self):
"""
Test symfit against a straight line, for which the parameters and their
uncertainties are known analytically. Assuming equal weights.
:return:
"""
data = [[0, 1], [1, 0], [3, 2], [5, 4]]
x, y = (np.array(i, dtype='float64') for i in zip(*data))
# x = np.arange(0, 100, 0.1)
# np.random.seed(10)
# y = 3.0*x + 105.0 + np.random.normal(size=x.shape)
dx = x - x.mean()
dy = y - y.mean()
mean_squared_x = np.mean(x**2) - np.mean(x)**2
mean_xy = np.mean(x * y) - np.mean(x)*np.mean(y)
a = mean_xy/mean_squared_x
b = y.mean() - a * x.mean()
self.assertAlmostEqual(a, 0.694915, 6) # values from Mathematica
self.assertAlmostEqual(b, 0.186441, 6)
print(a, b)
S = np.sum((y - (a*x + b))**2)
var_a_exact = S/(len(x) * (len(x) - 2) * mean_squared_x)
var_b_exact = var_a_exact*np.mean(x ** 2)
a_exact = a
b_exact = b
# We will now compare these exact results with values from symfit
a, b, x_var = Parameter(name='a', value=3.0), Parameter(name='b'), Variable(name='x')
model = a*x_var + b
fit = Fit(model, x, y, absolute_sigma=False)
fit_result = fit.execute()
popt, pcov = curve_fit(lambda z, c, d: c * z + d, x, y,
Dfun=lambda p, x, y, func: np.transpose([x, np.ones_like(x)]))
# Dfun=lambda p, x, y, func: print(p, func, x, y))
# curve_fit
self.assertAlmostEqual(a_exact, popt[0], 4)
self.assertAlmostEqual(b_exact, popt[1], 4)
self.assertAlmostEqual(var_a_exact, pcov[0][0], 6)
self.assertAlmostEqual(var_b_exact, pcov[1][1], 6)
self.assertAlmostEqual(a_exact, fit_result.params.a, 4)
self.assertAlmostEqual(b_exact, fit_result.params.b, 4)
self.assertAlmostEqual(var_a_exact**0.5, fit_result.params.a_stdev, 6)
self.assertAlmostEqual(var_b_exact**0.5, fit_result.params.b_stdev, 6)
if __name__ == '__main__':
unittest.main()<|fim▁end|> | y0_1 = Parameter(0.7, min=0.6, max=0.8)
sig_y_1 = Parameter(0.1, min=0.0, max=0.2)
A_1 = Parameter()
g_1 = A_1 * Gaussian(x, x0_1, sig_x_1) * Gaussian(y, y0_1, sig_y_1) |
<|file_name|>point_2d.rs<|end_file_name|><|fim▁begin|>#[cfg(test)]
#[path="../../../../tests/support/collisions/shapes/_2d/arbitrary_point_2d.rs"]
mod arbitrary;
use std::mem;
use std::ops::Deref;
<|fim▁hole|>use maths::_2d::Vec2D;
use collisions::shapes::Shape;
#[derive(Clone, Debug)]
pub struct Point2D(pub Vec2D);
impl Shape for Point2D {}
impl From<Point2D> for Vec2D {
fn from(point: Point2D) -> Vec2D {
point.0
}
}
impl Deref for Vec2D {
type Target = Point2D;
fn deref(&self) -> &Self::Target {
unsafe { mem::transmute(self) }
}
}<|fim▁end|> | |
<|file_name|>queue_config.cpp<|end_file_name|><|fim▁begin|>/*
Copyright (C) 2017 Equinor ASA, Norway.
The file 'queue_config.c' is part of ERT - Ensemble based Reservoir Tool.
ERT is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ERT is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
for more details.
*/
#include <stdlib.h>
#include <ert/util/util.h>
#include <ert/job_queue/job_queue.hpp>
#include <ert/job_queue/ext_job.hpp>
#include <ert/job_queue/lsf_driver.hpp>
#include <ert/job_queue/slurm_driver.hpp>
#include <ert/config/config_parser.hpp>
#include <ert/enkf/queue_config.hpp>
#include <ert/enkf/enkf_defaults.hpp>
#include <ert/enkf/site_config.hpp>
#include <ert/enkf/model_config.hpp>
struct queue_config_struct {
job_driver_type driver_type;
char *job_script;
hash_type *queue_drivers;
bool user_mode;
int max_submit;
int num_cpu;
};
static void queue_config_add_queue_driver(queue_config_type *queue_config,
const char *driver_name,
queue_driver_type *driver);
static bool queue_config_init(queue_config_type *queue_config,
const config_content_type *config_content);
static queue_config_type *queue_config_alloc_empty() {
queue_config_type *queue_config =
(queue_config_type *)util_malloc(sizeof *queue_config);
queue_config->queue_drivers = hash_alloc();
queue_config->job_script = NULL;
queue_config->driver_type = NULL_DRIVER;
queue_config->user_mode = false;
queue_config->max_submit = 2; // Default value
queue_config->num_cpu = 0;
return queue_config;
}
static queue_config_type *queue_config_alloc_default() {
queue_config_type *queue_config = queue_config_alloc_empty();
config_parser_type *config = config_alloc();
config_content_type *content = site_config_alloc_content(config);
queue_config_init(queue_config, content);
config_free(config);
config_content_free(content);
return queue_config;
}
queue_config_type *queue_config_alloc_load(const char *user_config_file) {
config_parser_type *config = config_alloc();
config_content_type *content = NULL;
if (user_config_file)
content = model_config_alloc_content(user_config_file, config);
queue_config_type *queue_config = queue_config_alloc(content);
config_free(config);
config_content_free(content);
return queue_config;
}
queue_config_type *
queue_config_alloc(const config_content_type *config_content) {
queue_config_type *queue_config = queue_config_alloc_default();
if (config_content) {
queue_config->user_mode = true;
queue_config_init(queue_config, config_content);
}
return queue_config;
}
queue_config_type *queue_config_alloc_full(char *job_script, bool user_mode,
int max_submit, int num_cpu,
job_driver_type driver_type) {
queue_config_type *queue_config =
(queue_config_type *)util_malloc(sizeof *queue_config);
queue_config->queue_drivers = hash_alloc();
queue_config_create_queue_drivers(queue_config);
queue_config->job_script = util_alloc_string_copy(job_script);
queue_config->driver_type = static_cast<job_driver_type>(driver_type);
queue_config->user_mode = user_mode;
queue_config->max_submit = max_submit;
queue_config->num_cpu = num_cpu;
return queue_config;
}
queue_config_type *
queue_config_alloc_local_copy(queue_config_type *queue_config) {
queue_config_type *queue_config_copy =
(queue_config_type *)util_malloc(sizeof *queue_config_copy);
queue_config_copy->queue_drivers = hash_alloc();
queue_config_add_queue_driver(queue_config_copy, LOCAL_DRIVER_NAME,
queue_driver_alloc_local());
queue_config_copy->user_mode = queue_config->user_mode;
if (queue_config_has_job_script(queue_config)) {
queue_config_copy->job_script =
util_alloc_string_copy(queue_config->job_script);
} else
queue_config_copy->job_script = NULL;
if (queue_config->driver_type == NULL_DRIVER)
queue_config_copy->driver_type = NULL_DRIVER;
else
queue_config_copy->driver_type = LOCAL_DRIVER;
queue_config_copy->max_submit = queue_config->max_submit;
return queue_config_copy;
}
/*
The filenames "OK", "status.json" and "ERROR" passed to the job_queue_alloc
function must be syncronized with the script running the forward model.
*/
job_queue_type *
queue_config_alloc_job_queue(const queue_config_type *queue_config) {
job_queue_type *job_queue =
job_queue_alloc(DEFAULT_MAX_SUBMIT, "OK", "status.json", "ERROR");
const char *driver_name = queue_config_get_queue_system(queue_config);
if (driver_name != NULL) {
queue_driver_type *driver =
queue_config_get_queue_driver(queue_config, driver_name);
job_queue_set_driver(job_queue, driver);
}
job_queue_set_max_submit(job_queue, queue_config->max_submit);
return job_queue;
}
void queue_config_free(queue_config_type *queue_config) {
hash_free(queue_config->queue_drivers);
free(queue_config->job_script);
free(queue_config);
}
const char *
queue_config_get_queue_system(const queue_config_type *queue_config) {
switch (queue_config->driver_type) {
case LSF_DRIVER:
return LSF_DRIVER_NAME;
case RSH_DRIVER:
return RSH_DRIVER_NAME;
case LOCAL_DRIVER:
return LOCAL_DRIVER_NAME;
case TORQUE_DRIVER:
return TORQUE_DRIVER_NAME;
case SLURM_DRIVER:
return SLURM_DRIVER_NAME;
default:
return NULL;
}
return NULL;
}
int queue_config_get_max_submit(queue_config_type *queue_config) {
return queue_config->max_submit;
}
const char *queue_config_get_job_script(const queue_config_type *queue_config) {
return queue_config->job_script;
}
bool queue_config_has_job_script(const queue_config_type *queue_config) {
if (queue_config->job_script)
return true;
else
return false;
}
bool queue_config_set_job_script(queue_config_type *queue_config,
const char *job_script) {
if (!util_is_executable(job_script))
return false;
char *job_script_full_path = util_alloc_realpath(job_script);
queue_config->job_script = util_realloc_string_copy(
queue_config->job_script, job_script_full_path);
free(job_script_full_path);
return true;
}
static void queue_config_set_queue_option(queue_config_type *queue_config,
const char *driver_name,
const char *option_key,
const char *option_value) {
if (queue_config_has_queue_driver(queue_config, driver_name)) {
queue_driver_type *driver =
queue_config_get_queue_driver(queue_config, driver_name);
if (!queue_driver_set_option(driver, option_key, option_value))
fprintf(stderr,
"** Warning: Option:%s or its value is not recognized by "
"driver:%s- ignored \n",
option_key, driver_name);
} else
fprintf(stderr, "** Warning: Driver:%s not recognized - ignored \n",
driver_name);
}
static void queue_config_unset_queue_option(queue_config_type *queue_config,
const char *driver_name,
const char *option_key) {
if (queue_config_has_queue_driver(queue_config, driver_name)) {
queue_driver_type *driver =
queue_config_get_queue_driver(queue_config, driver_name);
if (!queue_driver_unset_option(driver, option_key))
fprintf(stderr,
"** Warning: Option:%s is not recognized by driver:%s- "<|fim▁hole|> option_key, driver_name);
} else
fprintf(stderr, "** Warning: Driver:%s not recognized - ignored \n",
driver_name);
}
static void queue_config_add_queue_driver(queue_config_type *queue_config,
const char *driver_name,
queue_driver_type *driver) {
hash_insert_hash_owned_ref(queue_config->queue_drivers, driver_name, driver,
queue_driver_free__);
}
queue_driver_type *
queue_config_get_queue_driver(const queue_config_type *queue_config,
const char *driver_name) {
return (queue_driver_type *)hash_get(queue_config->queue_drivers,
driver_name);
}
void queue_config_create_queue_drivers(queue_config_type *queue_config) {
queue_config_add_queue_driver(queue_config, LSF_DRIVER_NAME,
queue_driver_alloc_LSF(NULL, NULL, NULL));
queue_config_add_queue_driver(queue_config, TORQUE_DRIVER_NAME,
queue_driver_alloc_TORQUE());
queue_config_add_queue_driver(queue_config, RSH_DRIVER_NAME,
queue_driver_alloc_RSH(NULL, NULL));
queue_config_add_queue_driver(queue_config, LOCAL_DRIVER_NAME,
queue_driver_alloc_local());
queue_config_add_queue_driver(queue_config, SLURM_DRIVER_NAME,
queue_driver_alloc_slurm());
}
bool queue_config_has_queue_driver(const queue_config_type *queue_config,
const char *driver_name) {
return hash_has_key(queue_config->queue_drivers, driver_name);
}
static bool queue_config_init(queue_config_type *queue_config,
const config_content_type *config_content) {
if (!queue_config->user_mode)
queue_config_create_queue_drivers(queue_config);
if (config_content_has_item(config_content, QUEUE_SYSTEM_KEY)) {
const char *queue_system =
config_content_get_value(config_content, QUEUE_SYSTEM_KEY);
if (strcmp(queue_system, LSF_DRIVER_NAME) == 0) {
queue_config->driver_type = LSF_DRIVER;
} else if (strcmp(queue_system, RSH_DRIVER_NAME) == 0)
queue_config->driver_type = RSH_DRIVER;
else if (strcmp(queue_system, LOCAL_DRIVER_NAME) == 0)
queue_config->driver_type = LOCAL_DRIVER;
else if (strcmp(queue_system, TORQUE_DRIVER_NAME) == 0)
queue_config->driver_type = TORQUE_DRIVER;
else if (strcmp(queue_system, SLURM_DRIVER_NAME) == 0)
queue_config->driver_type = SLURM_DRIVER;
else {
util_abort("%s: queue system :%s not recognized \n", __func__,
queue_system);
queue_config->driver_type = NULL_DRIVER;
}
}
if (config_content_has_item(config_content, NUM_CPU_KEY))
queue_config->num_cpu =
config_content_get_value_as_int(config_content, NUM_CPU_KEY);
if (config_content_has_item(config_content, JOB_SCRIPT_KEY)) {
queue_config_set_job_script(queue_config,
config_content_get_value_as_executable(
config_content, JOB_SCRIPT_KEY));
}
if (config_content_has_item(config_content, MAX_SUBMIT_KEY))
queue_config->max_submit =
config_content_get_value_as_int(config_content, MAX_SUBMIT_KEY);
/* Setting QUEUE_OPTIONS */
for (int i = 0;
i < config_content_get_occurences(config_content, QUEUE_OPTION_KEY);
i++) {
const stringlist_type *tokens = config_content_iget_stringlist_ref(
config_content, QUEUE_OPTION_KEY, i);
const char *driver_name = stringlist_iget(tokens, 0);
const char *option_key = stringlist_iget(tokens, 1);
if (stringlist_get_size(tokens) > 2) {
char *option_value = stringlist_alloc_joined_substring(
tokens, 2, stringlist_get_size(tokens), " ");
// If it is essential to keep the exact number of spaces in the
// option_value, it should be quoted with "" in the configuration
// file.
queue_config_set_queue_option(queue_config, driver_name, option_key,
option_value);
free(option_value);
} else
queue_config_unset_queue_option(queue_config, driver_name,
option_key);
}
return true;
}
job_driver_type
queue_config_get_driver_type(const queue_config_type *queue_config) {
return queue_config->driver_type;
}
int queue_config_get_num_cpu(const queue_config_type *queue_config) {
return queue_config->num_cpu;
}
void queue_config_add_config_items(config_parser_type *parser, bool site_mode) {
{
config_schema_item_type *item =
config_add_schema_item(parser, MAX_SUBMIT_KEY, false);
config_schema_item_set_argc_minmax(item, 1, 1);
config_schema_item_iset_type(item, 0, CONFIG_INT);
}
{
config_schema_item_type *item =
config_add_schema_item(parser, NUM_CPU_KEY, false);
config_schema_item_set_argc_minmax(item, 1, 1);
config_schema_item_iset_type(item, 0, CONFIG_INT);
}
{
config_schema_item_type *item =
config_add_schema_item(parser, QUEUE_SYSTEM_KEY, site_mode);
config_schema_item_set_argc_minmax(item, 1, 1);
}
{
config_schema_item_type *item =
config_add_schema_item(parser, QUEUE_OPTION_KEY, false);
config_schema_item_set_argc_minmax(item, 2, CONFIG_DEFAULT_ARG_MAX);
}
{
config_schema_item_type *item =
config_add_schema_item(parser, JOB_SCRIPT_KEY, false);
config_schema_item_set_argc_minmax(item, 1, 1);
config_schema_item_iset_type(item, 0, CONFIG_EXECUTABLE);
}
}
const char *queue_config_lsf_queue_name() { return LSF_QUEUE; }
const char *queue_config_lsf_server() { return LSF_SERVER; }
const char *queue_config_lsf_resource() { return LSF_RESOURCE; }
const char *queue_config_lsf_driver_name() { return LSF_DRIVER_NAME; }<|fim▁end|> | "ignored \n", |
<|file_name|>top.js<|end_file_name|><|fim▁begin|>$(function() {<|fim▁hole|> logOut : function() {
window.parent.location.href = "logout";
}
}
})<|fim▁end|> | YtopMgr = {
//退出账号 |
<|file_name|>infiniteScroll.directive.ts<|end_file_name|><|fim▁begin|>import { Directive, Output, EventEmitter, HostListener } from '@angular/core';
@Directive({
selector: '[infiniteScroll]',
})
export class InfiniteScrollDirective {
@Output() public endOfPage: EventEmitter<any> = new EventEmitter<any>();
<|fim▁hole|> // tslint:disable
let scrollTop = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop || 0;
if(scrollTop + window.innerHeight + 100 >= document.body.scrollHeight) {
this.endOfPage.emit();
}
}
}<|fim▁end|> | @HostListener('window:scroll')
public scrollPage() { |
<|file_name|>py2_bad.py<|end_file_name|><|fim▁begin|># Requires trailing commas in Py2 but syntax error in Py3k
def True(
foo
):
True(
foo
)
def False(
foo
):
False(
foo
)
def None(
foo
):
None(
foo
)
def nonlocal (
foo
):
nonlocal(
foo<|fim▁hole|><|fim▁end|> | ) |
<|file_name|>application.js<|end_file_name|><|fim▁begin|>import Ember from 'ember';
import ApplicationRouteMixin from 'ember-simple-auth/mixins/application-route-mixin';
import config from 'ilios/config/environment';
const { inject } = Ember;
const { service } = inject;
export default Ember.Route.extend(ApplicationRouteMixin, {
flashMessages: service(),
commonAjax: service(),
i18n: service(),
moment: service(),
/**
* Leave titles as an array
* All of our routes send translations for the 'titleToken' key and we do the translating in head.hbs
* and in the application controller.
* @param Array tokens
* @return Array
*/
title(tokens){
return tokens;<|fim▁hole|> if (!Ember.testing) {
let logoutUrl = '/auth/logout';
return this.get('commonAjax').request(logoutUrl).then(response => {
if(response.status === 'redirect'){
window.location.replace(response.logoutUrl);
} else {
this.get('flashMessages').success('general.confirmLogout');
window.location.replace(config.rootURL);
}
});
}
},
beforeModel() {
const i18n = this.get('i18n');
const moment = this.get('moment');
moment.setLocale(i18n.get('locale'));
},
actions: {
willTransition: function() {
let controller = this.controllerFor('application');
controller.set('errors', []);
controller.set('showErrorDisplay', false);
}
}
});<|fim▁end|> | },
//Override the default session invalidator so we can do auth stuff
sessionInvalidated() { |
<|file_name|>_regexpfathername.py<|end_file_name|><|fim▁begin|>#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2002-2006 Donald N. Allingham
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
from ....const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#-------------------------------------------------------------------------
#<|fim▁hole|>#
#-------------------------------------------------------------------------
from ..person import RegExpName
from ._memberbase import father_base
#-------------------------------------------------------------------------
#
# RegExpFatherName
#
#-------------------------------------------------------------------------
class RegExpFatherName(RegExpName):
"""Rule that checks for full or partial name matches"""
name = _('Families with father matching the <regex_name>')
description = _("Matches families whose father has a name "
"matching a specified regular expression")
category = _('Father filters')
base_class = RegExpName
apply = father_base<|fim▁end|> | # Gramps modules |
<|file_name|>debounce-searches-1-js.js<|end_file_name|><|fim▁begin|>import Controller from '@ember/controller';
import { debounce } from '@ember/runloop';
import fetch from 'fetch';
import RSVP from 'rsvp';
export default class extends Controller {
searchRepo(term) {
return new RSVP.Promise((resolve, reject) => {<|fim▁hole|> }
}
function _performSearch(term, resolve, reject) {
let url = `https://api.github.com/search/repositories?q=${term}`;
fetch(url).then((resp) => resp.json()).then((json) => resolve(json.items), reject);
}<|fim▁end|> | debounce(_performSearch, term, resolve, reject, 600);
}); |
<|file_name|>run_swarming_xcode_install.py<|end_file_name|><|fim▁begin|>#!/usr/bin/env python
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
This script runs swarming_xcode_install on the bots. It should be run when we
need to upgrade all the swarming testers. It:
1) Packages two python files into an isolate.
2) Runs the isolate on swarming machines that satisfy certain dimensions.
Example usage:
$ ./build/run_swarming_xcode_install.py --luci_path ~/work/luci-py \
--swarming-server touch-swarming.appspot.com \
--isolate-server touch-isolate.appspot.com<|fim▁hole|>import argparse
import os
import shutil
import subprocess
import sys
import tempfile
def main():
parser = argparse.ArgumentParser(
description='Run swarming_xcode_install on the bots.')
parser.add_argument('--luci_path', required=True, type=os.path.abspath)
parser.add_argument('--swarming-server', required=True, type=str)
parser.add_argument('--isolate-server', required=True, type=str)
parser.add_argument('--batches', type=int, default=25,
help="Run xcode install in batches of size |batches|.")
parser.add_argument('--dimension', nargs=2, action='append')
args = parser.parse_args()
args.dimension = args.dimension or []
script_dir = os.path.dirname(os.path.abspath(__file__))
tmp_dir = tempfile.mkdtemp(prefix='swarming_xcode')
try:
print('Making isolate.')
shutil.copyfile(os.path.join(script_dir, 'swarming_xcode_install.py'),
os.path.join(tmp_dir, 'swarming_xcode_install.py'))
shutil.copyfile(os.path.join(script_dir, 'mac_toolchain.py'),
os.path.join(tmp_dir, 'mac_toolchain.py'))
luci_client = os.path.join(args.luci_path, 'client')
cmd = [
sys.executable, os.path.join(luci_client, 'isolateserver.py'), 'archive',
'-I', args.isolate_server, tmp_dir,
]
isolate_hash = subprocess.check_output(cmd).split()[0]
print('Running swarming_xcode_install.')
# TODO(crbug.com/765361): The dimensions below should be updated once
# swarming for iOS is fleshed out, likely removing xcode_version 9 and
# adding different dimensions.
luci_tools = os.path.join(luci_client, 'tools')
dimensions = [['pool', 'Chrome'], ['xcode_version', '9.0']] + args.dimension
dim_args = []
for d in dimensions:
dim_args += ['--dimension'] + d
cmd = [
sys.executable, os.path.join(luci_tools, 'run_on_bots.py'),
'--swarming', args.swarming_server, '--isolate-server',
args.isolate_server, '--priority', '20', '--batches', str(args.batches),
'--tags', 'name:run_swarming_xcode_install',
] + dim_args + ['--name', 'run_swarming_xcode_install', '--', isolate_hash,
'python', 'swarming_xcode_install.py',
]
subprocess.check_call(cmd)
print('All tasks completed.')
finally:
shutil.rmtree(tmp_dir)
return 0
if __name__ == '__main__':
sys.exit(main())<|fim▁end|> | """
from __future__ import print_function
|
<|file_name|>mod.rs<|end_file_name|><|fim▁begin|>//! Common data for testing
pub mod hwb_test_data;<|fim▁hole|>pub use self::rgb_hs_test_data::make_test_array as build_hs_test_data;
pub use self::rgb_hs_test_data::TestColor as HsTestColor;<|fim▁end|> | pub mod rgb_hs_test_data;
pub use self::hwb_test_data::build_test_data as build_hwb_test_data;
pub use self::hwb_test_data::TestColor as HwbTestColor; |
<|file_name|>reducer_posts.js<|end_file_name|><|fim▁begin|>import fuzzy from 'fuzzy';
import { resolve } from 'redux-simple-promise';
import {
FETCH_POSTS,
FETCH_POST,
FETCH_PAGE,
FETCH_POSTS_CATEGORY,
FETCH_POSTS_TAG
} from '../actions/index';
const INITIAL_STATE = { all: {}, post: {}, page: {}, category: {} };
export default function (state = INITIAL_STATE, action) {
switch (action.type) {
case resolve(FETCH_POSTS): {
const data = action.payload.data.entries;
const payload = [];<|fim▁hole|> post: '',
extract(el) {
return `${el.title} ${el.tags.map((tag) => `${tag} `)} `;
}
};
const results = fuzzy.filter(action.meta.term, data, options);
results.map((el) => {
if (el.score > 6) {
payload.push(el.original);
}
});
return { ...state, all: payload };
}
data.map((el) => {
if (el.meta.type === 'post') {
payload.push(el);
}
});
return { ...state, all: payload };
}
case resolve(FETCH_POSTS_CATEGORY): {
const data = action.payload.data.entries;
const payload = [];
data.map((el) => {
if (el.meta.categories.includes(action.meta.category)) {
payload.push(el);
}
});
return { ...state, category: payload };
}
case resolve(FETCH_POSTS_TAG): {
const data = action.payload.data.entries;
const payload = [];
data.map((el) => {
if (el.tags.includes(action.meta.tag)) {
payload.push(el);
}
});
return { ...state, category: payload };
}
case resolve(FETCH_POST): {
const data = action.payload.data.entries;
let payload;
data.map((el) => {
if (el.title === action.meta.title) {
payload = el;
}
});
return { ...state, post: payload };
}
case resolve(FETCH_PAGE): {
const data = action.payload.data;
return { ...state, page: data };
}
default:
return state;
}
}<|fim▁end|> |
if (typeof action.meta.term !== 'undefined') {
const options = {
pre: '', |
<|file_name|>index.d.ts<|end_file_name|><|fim▁begin|><|fim▁hole|>import { StrategyBase } from "./strategies/StrategyBase";
export { BufferCodec, BufferSchema, BufferStrategy, BufferTemplate, BufferValueTemplate, StrategyBase, };<|fim▁end|> | import { BufferCodec } from "./BufferCodec";
import { BufferSchema } from "./BufferSchema";
import { BufferStrategy } from "./BufferStrategy";
import { BufferTemplate, BufferValueTemplate } from "./buffer.types"; |
<|file_name|>import_bradford.py<|end_file_name|><|fim▁begin|><|fim▁hole|>from data_collection.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = 'E08000032'
addresses_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017.tsvJune2017.tsv'
stations_name = 'parl.2017-06-08/Version 1/Democracy_Club__08June2017.tsvJune2017.tsv'
elections = ['parl.2017-06-08']
csv_delimiter = '\t'<|fim▁end|> | |
<|file_name|>MaterialPicker.cc<|end_file_name|><|fim▁begin|>/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2014 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*--------------------------------------------------------------------------- *
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "MaterialPicker.hh"
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <OpenFlipper/common/GlobalOptions.hh>
#include <ACG/QtWidgets/QtMaterialDialog.hh>
#include <sstream>
//------------------------------------------------------------------------------
MaterialPicker::MaterialPicker()
:
pickModeName_("MaterialPicker"),
propName_(name()+QString("/Materials")),
pickMaterialButton_(0),
fillMaterialButton_(0),
materialListWidget_(0),
materialStrings_(),
shortKeyRow_(),
materialNode_(),
pickMaterial_(false),
fillMaterial_(false)
{
}
//------------------------------------------------------------------------------
MaterialPicker::~MaterialPicker() {
}
//------------------------------------------------------------------------------
void MaterialPicker::initializePlugin() {
QWidget* toolBox = new QWidget();
pickMaterialButton_ = new QPushButton("&pick Material", toolBox);
fillMaterialButton_ = new QPushButton("&fill Material", toolBox);
QPushButton* clearListButton = new QPushButton("Clear List", toolBox);
QPushButton* removeItemButton = new QPushButton("Remove", toolBox);
pickMaterialButton_->setCheckable(true);
fillMaterialButton_->setCheckable(true);
QLabel* materials = new QLabel("Materials:");
materialListWidget_ = new QListWidget(toolBox);
//load saved materials
materialStrings_ = OpenFlipperSettings().value(propName_, QStringList()).toStringList();
for (int i = 0; i < materialStrings_.size(); ++i)
{
QStringList savedString = materialStrings_[i].split(";");
std::stringstream stream;
MaterialInfo materialInfo;
stream << savedString[1].toStdString();
stream >> materialInfo.color_material;
stream.str("");
stream.clear();
stream << savedString[2].toStdString();
stream >> materialInfo.base_color;
stream.str("");
stream.clear();
stream << savedString[3].toStdString();
stream >> materialInfo.ambient_color;
stream.str("");
stream.clear();
stream << savedString[4].toStdString();
stream >> materialInfo.diffuse_color;
stream.str("");
stream.clear();
stream << savedString[5].toStdString();
stream >> materialInfo.specular_color;
stream.str("");
stream.clear();
stream << savedString[6].toStdString();
stream >> materialInfo.shininess;
stream.str("");
stream.clear();
stream << savedString[7].toStdString();
stream >> materialInfo.reflectance;
stream.str("");
stream.clear();
stream << savedString[8].toStdString();
stream >> materialInfo.key;
if (materialInfo.key != Qt::Key_unknown)
shortKeyRow_[materialInfo.key] = materialListWidget_->count();
materialListWidget_->addItem( itemName(savedString[0],materialInfo.key) );
materialList_.push_back(materialInfo);
}
//if material was saved, set first as current
if (materialStrings_.size())
materialListWidget_->setCurrentItem(materialListWidget_->item(0));
else
fillMaterialButton_->setEnabled(false);
QGridLayout* removeGrid = new QGridLayout();
removeGrid->addWidget(removeItemButton,0,0);
removeGrid->addWidget(clearListButton,0,1);
QGridLayout* pickGrid = new QGridLayout();
pickGrid->addWidget(pickMaterialButton_, 0, 0);
pickGrid->addWidget(fillMaterialButton_, 0, 1);
QBoxLayout* layout = new QBoxLayout(QBoxLayout::TopToBottom, toolBox);
layout->addWidget(materials);
layout->addWidget(materialListWidget_);
layout->addLayout(removeGrid);
layout->addLayout(pickGrid);
connect(pickMaterialButton_, SIGNAL(clicked()), this, SLOT(slotPickMaterialMode()));
connect(fillMaterialButton_, SIGNAL(clicked()), this, SLOT(slotFillMaterialMode()));
connect(clearListButton, SIGNAL(clicked()), this, SLOT(clearList()));
connect(materialListWidget_, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(editMode(QListWidgetItem*)));
connect(materialListWidget_->itemDelegate(), SIGNAL(closeEditor(QWidget*, QAbstractItemDelegate::EndEditHint)),this,SLOT(saveNewName(QWidget*, QAbstractItemDelegate::EndEditHint)));
connect(removeItemButton, SIGNAL(clicked()), this, SLOT(slotRemoveCurrentItem()));
connect(materialListWidget_,SIGNAL(customContextMenuRequested(const QPoint&)),this,SLOT(createContextMenu(const QPoint&)));
materialListWidget_->setContextMenuPolicy(Qt::CustomContextMenu);
QIcon* toolIcon = new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"material_picker.png");
emit addToolbox( tr("Material Picker"), toolBox, toolIcon);
}
//------------------------------------------------------------------------------
void MaterialPicker::removeItem(QListWidgetItem* _item)
{
unsigned index = materialListWidget_->row(_item);
materialListWidget_->takeItem(index);
materialList_.erase(materialList_.begin()+index);
materialStrings_.erase(materialStrings_.begin()+index);
if (materialStrings_.isEmpty())
OpenFlipperSettings().remove(propName_);
else
OpenFlipperSettings().setValue(propName_, materialStrings_);
fillMaterialButton_->setEnabled(materialListWidget_->count());
//update hotkey table
std::map<int,size_t>::iterator eraseIter = shortKeyRow_.end();
for (std::map<int,size_t>::iterator iter = shortKeyRow_.begin(); iter != shortKeyRow_.end(); ++iter)
{
if (iter->second > index)
--(iter->second);
else if (iter->second == index)
eraseIter = iter;
}
if (eraseIter != shortKeyRow_.end())
shortKeyRow_.erase(eraseIter);
}
//------------------------------------------------------------------------------
void MaterialPicker::clearList() {
materialListWidget_->clear();
materialList_.clear();
materialStrings_.clear();
fillMaterialButton_->setEnabled(false);
//setting value empty instead of removing will cause an error at start up
OpenFlipperSettings().remove(propName_);
}
//------------------------------------------------------------------------------
void MaterialPicker::slotRemoveCurrentItem()
{
if (!materialListWidget_->count())
return;
QMessageBox msgBox;
QListWidgetItem* item = materialListWidget_->currentItem();
msgBox.setText(tr("Remove ")+plainName(item->text(),materialListWidget_->currentRow())+tr("?"));
msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
msgBox.setDefaultButton(QMessageBox::Ok);
int ret = msgBox.exec();
if (ret == QMessageBox::Ok)
removeItem(materialListWidget_->currentItem());
}
//------------------------------------------------------------------------------
void MaterialPicker::slotPickMaterialMode() {
pickMaterialButton_->setChecked(true);
fillMaterialButton_->setChecked(false);
pickMaterial_ = true;
fillMaterial_ = false;
PluginFunctions::actionMode( Viewer::PickingMode );
PluginFunctions::pickMode(pickModeName_);
}
//------------------------------------------------------------------------------
void MaterialPicker::slotFillMaterialMode() {
fillMaterialButton_->setChecked(true);
pickMaterialButton_->setChecked(false);
fillMaterial_ = true;
pickMaterial_ = false;
PluginFunctions::actionMode( Viewer::PickingMode );
PluginFunctions::pickMode(pickModeName_);
}
//------------------------------------------------------------------------------
void MaterialPicker::pluginsInitialized() {
emit addPickMode(pickModeName_);
for (unsigned i = 0; i < supportedKeys_; ++i)
emit registerKey (Qt::Key_1+i, Qt::ControlModifier, QString(tr("Material %1")).arg(i+1), false);
}
<|fim▁hole|>
void MaterialPicker::slotMouseEvent(QMouseEvent* _event) {
if ( PluginFunctions::pickMode() != pickModeName_)
return;
if (_event->type() == QEvent::MouseButtonPress) {
unsigned int node_idx, target_idx;
OpenMesh::Vec3d hitPoint;
// Get picked object's identifier by picking in scenegraph
if ( PluginFunctions::scenegraphPick(ACG::SceneGraph::PICK_ANYTHING ,_event->pos(), node_idx, target_idx, &hitPoint) ){
BaseObjectData* object;
if ( PluginFunctions::getPickedObject(node_idx, object) ) {
// pick material
if ( pickMaterial_ && !fillMaterial_ ) {
MaterialNode* material = object->materialNode();
if (material) {
// store the material information
MaterialInfo materialInfo;
materialInfo.color_material = material->colorMaterial();
materialInfo.base_color = material->base_color();
materialInfo.ambient_color = material->ambient_color();
materialInfo.diffuse_color = material->diffuse_color();
materialInfo.specular_color = material->specular_color();
materialInfo.shininess = material->shininess();
materialInfo.reflectance = material->reflectance();
materialInfo.key = Qt::Key_unknown;
if (shortKeyRow_.size() < supportedKeys_)
{
materialInfo.key = Qt::Key_1+(int)shortKeyRow_.size();
shortKeyRow_[materialInfo.key] = materialListWidget_->count();
}
// update list widget and material list
QString name = QString("material id: %1").arg(material->id());
materialListWidget_->addItem( itemName(name,materialInfo.key) );
materialListWidget_->setCurrentItem( materialListWidget_->item(materialListWidget_->count() - 1) );
materialList_.push_back(materialInfo);
//save material
QString matStr = materialString(materialInfo,name);
materialStrings_.push_back(matStr);
OpenFlipperSettings().setValue(propName_, materialStrings_);
fillMaterialButton_->setEnabled(true);
OpenFlipperSettings().setValue(propName_, materialStrings_);
}
// apply material from current item in list widget to picked object
} else if ( fillMaterial_ && !pickMaterial_ ){
MaterialNode* material = object->materialNode();
if (material) {
if (materialListWidget_->count() > 0)
{
int row = materialListWidget_->currentRow();
material->colorMaterial(materialList_[row].color_material);
material->set_base_color(materialList_[row].base_color);
material->set_ambient_color(materialList_[row].ambient_color);
material->set_diffuse_color(materialList_[row].diffuse_color);
material->set_specular_color(materialList_[row].specular_color);
material->set_shininess(materialList_[row].shininess);
material->set_reflectance(materialList_[row].reflectance);
}
}
}
}
}
}
}
//------------------------------------------------------------------------------
void MaterialPicker::editModeCurrent()
{
editMode(materialListWidget_->currentItem());
}
//------------------------------------------------------------------------------
void MaterialPicker::editMode(QListWidgetItem* _item) {
_item->setFlags(_item->flags() | Qt::ItemIsEditable);
materialListWidget_->editItem(_item);
_item->setText( plainName(_item->text(),materialListWidget_->row(_item)));
}
//------------------------------------------------------------------------------
void MaterialPicker::saveNewName ( QWidget * _editor, QAbstractItemDelegate::EndEditHint _hint )
{
saveNewName(materialListWidget_->currentItem());
}
//------------------------------------------------------------------------------
QString MaterialPicker::plainName(const QString &string, int index)
{
if (materialList_[index].key == Qt::Key_unknown)
return string;
QString str(string);
return str.remove(0,4);
}
//------------------------------------------------------------------------------
void MaterialPicker::saveNewName (QListWidgetItem* _item)
{
unsigned index = materialListWidget_->row(_item);
QString str = materialStrings_[index];
QStringList strList = str.split(";");
//pass name
strList[0] = _item->text();
//highlight hotkey support
if (materialList_[index].key != Qt::Key_unknown)
_item->setText( itemName(strList[0], materialList_[index].key) );
//create new String to save
str = "";
for (int i = 0; i < strList.size()-1; ++i)
str += strList[i] + ";";
str += strList[strList.size()-1];
materialStrings_[index] = str;
OpenFlipperSettings().setValue(propName_, materialStrings_);
}
//------------------------------------------------------------------------------
QString MaterialPicker::itemName(const QString &_name, int _key)
{
if (_key == Qt::Key_unknown)
return _name;
return QString(tr("(%1) ")).arg(QString::number(_key-Qt::Key_1+1)) +_name;
}
//------------------------------------------------------------------------------
void MaterialPicker::slotPickModeChanged(const std::string& _mode) {
pickMaterialButton_->setChecked( _mode == pickModeName_ && pickMaterial_ );
fillMaterialButton_->setChecked( _mode == pickModeName_ && fillMaterial_ );
}
//------------------------------------------------------------------------------
void MaterialPicker::slotKeyEvent(QKeyEvent* _event)
{
for (unsigned i = 0; i < supportedKeys_; ++i)
{
int key = Qt::Key_1+i;
if (_event->key() == key && _event->modifiers() == Qt::ControlModifier)
{
if (shortKeyRow_.find(key) == shortKeyRow_.end())
return;
slotFillMaterialMode();
materialListWidget_->setCurrentRow((int)shortKeyRow_[key]);
}
}
}
//------------------------------------------------------------------------------
void MaterialPicker::changeHotKey(const int _key)
{
std::map<int,size_t>::iterator iter = shortKeyRow_.find(_key);
if (iter != shortKeyRow_.end())
{
//remove old key
int oldIndex = (int)iter->second;
QListWidgetItem* oldItem = materialListWidget_->item(oldIndex);
//remove name
oldItem->setText( plainName(oldItem->text(),oldIndex) );
materialList_[oldIndex].key = Qt::Key_unknown; //unregister key after rename, otherwise the renaming will fail
materialStrings_[oldIndex] = materialString(materialList_[oldIndex],oldItem->text());
saveNewName(oldItem);
}
//set the new item (save and hint)
int newIndex = materialListWidget_->currentRow();
QListWidgetItem* newItem = materialListWidget_->item(newIndex);
materialList_[newIndex].key = _key;
materialStrings_[newIndex] = materialString(materialList_[newIndex],newItem->text());
saveNewName(newItem);
shortKeyRow_[_key] = newIndex;
}
//------------------------------------------------------------------------------
QString MaterialPicker::materialString(const MaterialInfo& _mat, const QString &_name)
{
std::stringstream stream;
stream << _name.toStdString();
stream << ";" << _mat.color_material;
stream << ";" << _mat.base_color;
stream << ";" << _mat.ambient_color;
stream << ";" << _mat.diffuse_color;
stream << ";" << _mat.specular_color;
stream << ";" << _mat.shininess;
stream << ";" << _mat.reflectance;
stream << ";" << _mat.key;
return QString(stream.str().c_str());
}
//------------------------------------------------------------------------------
void MaterialPicker::slotMaterialProperties()
{
if (materialNode_)
return;
//QListWidgetItem* item = materialListWidget_->currentItem();
materialListWidget_->setDisabled(true);
materialNode_.reset(new MaterialNode());
int row = materialListWidget_->currentRow();
materialNode_->colorMaterial(materialList_[row].color_material);
materialNode_->set_base_color(materialList_[row].base_color);
materialNode_->set_ambient_color(materialList_[row].ambient_color);
materialNode_->set_diffuse_color(materialList_[row].diffuse_color);
materialNode_->set_specular_color(materialList_[row].specular_color);
materialNode_->set_shininess(materialList_[row].shininess);
materialNode_->set_reflectance(materialList_[row].reflectance);
ACG::QtWidgets::QtMaterialDialog* dialog = new ACG::QtWidgets::QtMaterialDialog( 0, materialNode_.get() );
dialog->setWindowFlags(dialog->windowFlags() | Qt::WindowStaysOnTopHint);
connect(dialog,SIGNAL(finished(int)),this,SLOT(slotEnableListWidget(int)));
connect(dialog,SIGNAL(accepted()),this,SLOT(slotMaterialChanged()));
dialog->setWindowIcon( QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"datacontrol-material.png"));
dialog->show();
}
//------------------------------------------------------------------------------
void MaterialPicker::slotMaterialChanged()
{
if (materialNode_)
{
int index = materialListWidget_->currentRow();
// store the material information
MaterialInfo materialInfo;
materialInfo.color_material = materialNode_->colorMaterial();
materialInfo.base_color = materialNode_->base_color();
materialInfo.ambient_color = materialNode_->ambient_color();
materialInfo.diffuse_color = materialNode_->diffuse_color();
materialInfo.specular_color = materialNode_->specular_color();
materialInfo.shininess = materialNode_->shininess();
materialInfo.reflectance = materialNode_->reflectance();
materialInfo.key = materialList_[index].key;
QString name = plainName(materialListWidget_->currentItem()->text(),materialListWidget_->currentRow());
materialStrings_[index] = materialString(materialInfo,name);
materialList_[index] = materialInfo;
OpenFlipperSettings().setValue(propName_, materialStrings_);
}
OpenFlipperSettings().setValue(propName_, materialStrings_);
}
//------------------------------------------------------------------------------
void MaterialPicker::slotEnableListWidget(int _save){
materialListWidget_->setEnabled(true);
if (_save == QDialog::Accepted)
slotMaterialChanged();
materialNode_.reset();
}
//------------------------------------------------------------------------------
void MaterialPicker::createContextMenu(const QPoint& _point)
{
QMenu *menu = new QMenu(materialListWidget_);
QAction* action = menu->addAction(tr("Material Properties"));
QIcon icon;
icon.addFile(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+"datacontrol-material.png");
action->setIcon(icon);
action->setEnabled(true);
connect(action,SIGNAL(triggered(bool)),this,SLOT(slotMaterialProperties()));
action = menu->addAction(tr("Rename"));
connect(action,SIGNAL(triggered(bool)),this,SLOT(editModeCurrent()));
action = menu->addAction(tr("Remove"));
connect(action, SIGNAL(triggered(bool)),this,SLOT(slotRemoveCurrentItem()));
menu->addSeparator();
//add hotkey selectors
QSignalMapper* signalMapper = new QSignalMapper(menu);
for (unsigned i = 0; i < supportedKeys_; ++i)
{
QAction* action = menu->addAction(tr("Key %1").arg(i+1));
connect(action,SIGNAL(triggered(bool)),signalMapper,SLOT(map()));
signalMapper->setMapping(action,Qt::Key_1+i);
std::map<int,size_t>::iterator iter = shortKeyRow_.find(Qt::Key_1+i);
//Disable already selected hotkey number
if (iter != shortKeyRow_.end() && iter->second == static_cast<size_t>(materialListWidget_->currentRow()))
action->setDisabled(true);
}
connect(signalMapper, SIGNAL(mapped(const int &)),this, SLOT(changeHotKey(const int &)));
menu->exec(materialListWidget_->mapToGlobal(_point),0);
}
#if QT_VERSION < 0x050000
Q_EXPORT_PLUGIN2( materialPicker , MaterialPicker );
#endif<|fim▁end|> | //------------------------------------------------------------------------------ |
<|file_name|>rx-operators.ts<|end_file_name|><|fim▁begin|>// Spelling out each operator we need helps save on bundle size, but it's a pain
// to type everywhere. So we keep them all here and you just have to import rx-operators.
import 'rxjs/add/observable/defer';
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/combineLatest';
import 'rxjs/add/observable/timer';
import 'rxjs/add/observable/fromEventPattern';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/observable/empty';
import 'rxjs/add/operator/distinctUntilChanged';
import 'rxjs/add/operator/startWith';<|fim▁hole|>import 'rxjs/add/operator/switchMap';
import 'rxjs/add/operator/publishReplay';
import 'rxjs/add/operator/shareReplay';
import 'rxjs/add/operator/take';
import 'rxjs/add/operator/subscribeOn';
import 'rxjs/add/operator/do';
import 'rxjs/add/operator/filter';<|fim▁end|> | import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/merge'; |
<|file_name|>rdbdata.py<|end_file_name|><|fim▁begin|>"""
Copyright (C) 2013 Stanislav Bobovych
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
class RDBDATA_data_entry:
def __init__(self, offset, file_pointer):
old_offset = file_pointer.tell()
file_pointer.seek(offset)
self.data_type, = struct.unpack("<I", file_pointer.read(4))
self.RDB_id, = = struct.unpack("<I", file_pointer.read(4))
self.data_length, = struct.unpack("<I", file_pointer.read(4))
self.unknown, = struct.unpack("<I", file_pointer.read(4))
self.data = file_pointer.read(self.data_length)
file_pointer.seek(old_offset)
class RDBDATA_file:
def __init__(self, filepath=None):
self.filepath = filepath
self.header = None #RDB0
self.data = None<|fim▁hole|> self.open(filepath)
def open(self, filepath=None):
if filepath == None and self.filepath == None:
print "File path is empty"
return
if self.filepath == None:
self.filepath = filepath
def dump(self, dest_filepath=os.getcwd(), verbose=False):
with open(self.filepath, "rb") as f:
self.header = struct.unpack("IIII", f.read(4))
self.data = f.read()<|fim▁end|> |
if self.filepath != None: |
<|file_name|>bootstrap-list-filter-contacts.js<|end_file_name|><|fim▁begin|>//borrowed from stefanocudini bootstrap-list-filter
(function($) {
$.fn.btsListFilterContacts = function(inputEl, options) {
var searchlist = this,
searchlist$ = $(this),
inputEl$ = $(inputEl),
items$ = searchlist$,
callData,
callReq; //last callData execution
function tmpl(str, data) {
return str.replace(/\{ *([\w_]+) *\}/g, function (str, key) {
return data[key] || '';
});
}
function debouncer(func, timeout) {
var timeoutID;
timeout = timeout || 300;
return function () {
var scope = this , args = arguments;
clearTimeout( timeoutID );
timeoutID = setTimeout( function () {
func.apply( scope , Array.prototype.slice.call( args ) );
}, timeout);
};
}
options = $.extend({<|fim▁hole|> initial: true,
eventKey: 'keyup',
resetOnBlur: true,
sourceData: null,
sourceTmpl: '<a class="list-group-item" href="#"><tr><h3><span>{title}</span></h3></tr></a>',
sourceNode: function(data) {
return tmpl(options.sourceTmpl, data);
},
emptyNode: function(data) {
return '<a class="list-group-item well" href="#"><span>No Results</span></a>';
},
itemEl: '.list-group-item',
itemChild: null,
itemFilter: function(item, val) {
//val = val.replace(new RegExp("^[.]$|[\[\]|()*]",'g'),'');
//val = val.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
val = val && val.replace(new RegExp("[({[^.$*+?\\\]})]","g"),'');
var text = $.trim($(item).text()),
i = options.initial ? '^' : '',
regSearch = new RegExp(i + val,'i');
return regSearch.test( text );
}
}, options);
inputEl$.on(options.eventKey, debouncer(function(e) {
var val = $(this).val();
console.log(val);
if(options.itemEl)
items$ = searchlist$.find(options.itemEl);
if(options.itemChild)
items$ = items$.find(options.itemChild);
var contains = items$.filter(function(){
return options.itemFilter.call(searchlist, this, val);
}),
containsNot = items$.not(contains);
if (options.itemChild){
contains = contains.parents(options.itemEl);
containsNot = containsNot.parents(options.itemEl).hide();
}
if(val!=='' && val.length >= options.minLength)
{
contains.show();
containsNot.hide();
if($.type(options.sourceData)==='function')
{
contains.hide();
containsNot.hide();
if(callReq)
{
if($.isFunction(callReq.abort))
callReq.abort();
else if($.isFunction(callReq.stop))
callReq.stop();
}
callReq = options.sourceData.call(searchlist, val, function(data) {
callReq = null;
contains.hide();
containsNot.hide();
searchlist$.find('.bts-dynamic-item').remove();
if(!data || data.length===0)
$( options.emptyNode.call(searchlist) ).addClass('bts-dynamic-item').appendTo(searchlist$);
else
for(var i in data)
$( options.sourceNode.call(searchlist, data[i]) ).addClass('bts-dynamic-item').appendTo(searchlist$);
});
} else if(contains.length===0) {
$( options.emptyNode.call(searchlist) ).addClass('bts-dynamic-item').appendTo(searchlist$);
}
}
else
{
contains.show();
containsNot.show();
searchlist$.find('.bts-dynamic-item').remove();
}
}, options.delay));
if(options.resetOnBlur)
inputEl$.on('blur', function(e) {
$(this).val('').trigger(options.eventKey);
});
return searchlist$;
};
})(jQuery);<|fim▁end|> | delay: 300,
minLength: 1, |
<|file_name|>unique-pat-2.rs<|end_file_name|><|fim▁begin|>// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]<|fim▁hole|>
enum bar { u(Box<Foo>), w(isize), }
pub fn main() {
assert!(match bar::u(box Foo{a: 10, b: 40}) {
bar::u(box Foo{a: a, b: b}) => { a + (b as isize) }
_ => { 66 }
} == 50);
}<|fim▁end|> | #![feature(box_patterns)]
#![feature(box_syntax)]
struct Foo {a: isize, b: usize} |
<|file_name|>_route_filters_operations.py<|end_file_name|><|fim▁begin|># coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
from azure.core.polling import LROPoller, NoPolling, PollingMethod
from azure.mgmt.core.exceptions import ARMErrorFormat
from azure.mgmt.core.polling.arm_polling import ARMPolling
from .. import models as _models
if TYPE_CHECKING:
# pylint: disable=unused-import,ungrouped-imports
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
<|fim▁hole|> T = TypeVar('T')
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
class RouteFiltersOperations(object):
"""RouteFiltersOperations operations.
You should not instantiate this class directly. Instead, you should create a Client instance that
instantiates it for you and attaches it as an attribute.
:ivar models: Alias to model classes used in this operation group.
:type models: ~azure.mgmt.network.v2020_05_01.models
:param client: Client for service requests.
:param config: Configuration of service client.
:param serializer: An object model serializer.
:param deserializer: An object model deserializer.
"""
models = _models
def __init__(self, client, config, serializer, deserializer):
self._client = client
self._serialize = serializer
self._deserialize = deserializer
self._config = config
def _delete_initial(
self,
resource_group_name, # type: str
route_filter_name, # type: str
**kwargs # type: Any
):
# type: (...) -> None
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-05-01"
accept = "application/json"
# Construct URL
url = self._delete_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.delete(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 202, 204]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if cls:
return cls(pipeline_response, None, {})
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore
def begin_delete(
self,
resource_group_name, # type: str
route_filter_name, # type: str
**kwargs # type: Any
):
# type: (...) -> LROPoller[None]
"""Deletes the specified route filter.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_filter_name: The name of the route filter.
:type route_filter_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns either None or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[None]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._delete_initial(
resource_group_name=resource_group_name,
route_filter_name=route_filter_name,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
if cls:
return cls(pipeline_response, None, {})
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore
def get(
self,
resource_group_name, # type: str
route_filter_name, # type: str
expand=None, # type: Optional[str]
**kwargs # type: Any
):
# type: (...) -> "_models.RouteFilter"
"""Gets the specified route filter.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_filter_name: The name of the route filter.
:type route_filter_name: str
:param expand: Expands referenced express route bgp peering resources.
:type expand: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: RouteFilter, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilter
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-05-01"
accept = "application/json"
# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
if expand is not None:
query_parameters['$expand'] = self._serialize.query("expand", expand, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
request = self._client.get(url, query_parameters, header_parameters)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('RouteFilter', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore
def _create_or_update_initial(
self,
resource_group_name, # type: str
route_filter_name, # type: str
route_filter_parameters, # type: "_models.RouteFilter"
**kwargs # type: Any
):
# type: (...) -> "_models.RouteFilter"
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-05-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self._create_or_update_initial.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(route_filter_parameters, 'RouteFilter')
body_content_kwargs['content'] = body_content
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200, 201]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
if response.status_code == 200:
deserialized = self._deserialize('RouteFilter', pipeline_response)
if response.status_code == 201:
deserialized = self._deserialize('RouteFilter', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
_create_or_update_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore
def begin_create_or_update(
self,
resource_group_name, # type: str
route_filter_name, # type: str
route_filter_parameters, # type: "_models.RouteFilter"
**kwargs # type: Any
):
# type: (...) -> LROPoller["_models.RouteFilter"]
"""Creates or updates a route filter in a specified resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_filter_name: The name of the route filter.
:type route_filter_name: str
:param route_filter_parameters: Parameters supplied to the create or update route filter
operation.
:type route_filter_parameters: ~azure.mgmt.network.v2020_05_01.models.RouteFilter
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be ARMPolling.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of LROPoller that returns either RouteFilter or the result of cls(response)
:rtype: ~azure.core.polling.LROPoller[~azure.mgmt.network.v2020_05_01.models.RouteFilter]
:raises ~azure.core.exceptions.HttpResponseError:
"""
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
)
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
if cont_token is None:
raw_result = self._create_or_update_initial(
resource_group_name=resource_group_name,
route_filter_name=route_filter_name,
route_filter_parameters=route_filter_parameters,
cls=lambda x,y,z: x,
**kwargs
)
kwargs.pop('error_map', None)
kwargs.pop('content_type', None)
def get_long_running_output(pipeline_response):
deserialized = self._deserialize('RouteFilter', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, path_format_arguments=path_format_arguments, **kwargs)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
if cont_token:
return LROPoller.from_continuation_token(
polling_method=polling_method,
continuation_token=cont_token,
client=self._client,
deserialization_callback=get_long_running_output
)
else:
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
begin_create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore
def update_tags(
self,
resource_group_name, # type: str
route_filter_name, # type: str
parameters, # type: "_models.TagsObject"
**kwargs # type: Any
):
# type: (...) -> "_models.RouteFilter"
"""Updates tags of a route filter.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:param route_filter_name: The name of the route filter.
:type route_filter_name: str
:param parameters: Parameters supplied to update route filter tags.
:type parameters: ~azure.mgmt.network.v2020_05_01.models.TagsObject
:keyword callable cls: A custom type or function that will be passed the direct response
:return: RouteFilter, or the result of cls(response)
:rtype: ~azure.mgmt.network.v2020_05_01.models.RouteFilter
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilter"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-05-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"
# Construct URL
url = self.update_tags.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'routeFilterName': self._serialize.url("route_filter_name", route_filter_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(parameters, 'TagsObject')
body_content_kwargs['content'] = body_content
request = self._client.patch(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
deserialized = self._deserialize('RouteFilter', pipeline_response)
if cls:
return cls(pipeline_response, deserialized, {})
return deserialized
update_tags.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}'} # type: ignore
def list_by_resource_group(
self,
resource_group_name, # type: str
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.RouteFilterListResult"]
"""Gets all route filters in a resource group.
:param resource_group_name: The name of the resource group.
:type resource_group_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either RouteFilterListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-05-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list_by_resource_group.metadata['url'] # type: ignore
path_format_arguments = {
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'),
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('RouteFilterListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters'} # type: ignore
def list(
self,
**kwargs # type: Any
):
# type: (...) -> Iterable["_models.RouteFilterListResult"]
"""Gets all route filters in a subscription.
:keyword callable cls: A custom type or function that will be passed the direct response
:return: An iterator like instance of either RouteFilterListResult or the result of cls(response)
:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.network.v2020_05_01.models.RouteFilterListResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.RouteFilterListResult"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2020-05-01"
accept = "application/json"
def prepare_request(next_link=None):
# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
if not next_link:
# Construct URL
url = self.list.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
request = self._client.get(url, query_parameters, header_parameters)
else:
url = next_link
query_parameters = {} # type: Dict[str, Any]
request = self._client.get(url, query_parameters, header_parameters)
return request
def extract_data(pipeline_response):
deserialized = self._deserialize('RouteFilterListResult', pipeline_response)
list_of_elem = deserialized.value
if cls:
list_of_elem = cls(list_of_elem)
return deserialized.next_link or None, iter(list_of_elem)
def get_next(next_link=None):
request = prepare_request(next_link)
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response
if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
return pipeline_response
return ItemPaged(
get_next, extract_data
)
list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeFilters'} # type: ignore<|fim▁end|> | |
<|file_name|>device.rs<|end_file_name|><|fim▁begin|>//! Provides the Cuda API with its device functionality.
use frameworks::cuda::{Device, DeviceInfo};
use byteorder::{ByteOrder, LittleEndian, WriteBytesExt};
use super::ffi::*;<|fim▁hole|> ///
/// Combines the fetching of all device ids and the fetching of the individual device
/// information.
pub fn load_devices() -> Result<Vec<Device>, Error> {
match API::load_device_list() {
Ok(device_list) => {
Ok(
device_list.iter().map(|device| {
device.clone()
.load_name()
.load_device_type()
.load_compute_units()
}).collect()
)
},
Err(err) => Err(err)
}
}
/// Returns a list of available devices for the provided platform.
pub fn load_device_list() -> Result<Vec<Device>, Error> {
let mut device_counter = 0;
try!(unsafe {API::ffi_device_get_count(&mut device_counter)});
Ok((0..device_counter).collect::<Vec<i32>>().iter().map(|ordinal| {
let mut device_id: CUdevice = 0;
let _ = unsafe { API::ffi_device_get(&mut device_id, *ordinal) };
Device::from_isize(device_id as isize)
}).collect::<Vec<Device>>())
}
/// Returns the requested DeviceInfo for the provided device.
pub fn load_device_info(device: &Device, info: CUdevice_attribute) -> Result<DeviceInfo, Error> {
match info {
CUdevice_attribute::CU_DEVICE_NAME => {
let mut name: [i8; 1024] = [0; 1024];
try!(unsafe { API::ffi_device_get_name(name.as_mut_ptr(), 1024, device.id_c()) });
let mut buf: Vec<u8> = vec![];
// Removes obsolete whitespaces.
for (i, char) in name.iter().enumerate() {
match *char {
0 => if i > 1 && name[i-1] != 0 { buf.push(*char as u8) },
_ => buf.push(*char as u8)
}
}
Ok(DeviceInfo::new(buf))
},
CUdevice_attribute::CU_DEVICE_MEMORY_TOTAL => {
unimplemented!()
},
_ => {
let mut value: ::libc::c_int = 0;
try!(unsafe { API::ffi_device_get_attribute(&mut value, info, device.id_c()) });
let mut buf = vec![];
buf.write_i32::<LittleEndian>(value).unwrap();
Ok(DeviceInfo::new(buf))
}
}
}
unsafe fn ffi_device_get(
device: *mut CUdevice,
ordinal: ::libc::c_int,
) -> Result<(), Error> {
match cuDeviceGet(device, ordinal) {
CUresult::CUDA_SUCCESS => Ok(()),
CUresult::CUDA_ERROR_DEINITIALIZED => Err(Error::Deinitialized("CUDA got deinitialized.")),
CUresult::CUDA_ERROR_NOT_INITIALIZED => Err(Error::NotInitialized("CUDA is not initialized.")),
CUresult::CUDA_ERROR_INVALID_CONTEXT => Err(Error::InvalidContext("No valid context available.")),
CUresult::CUDA_ERROR_INVALID_VALUE => Err(Error::InvalidValue("Invalid value provided.")),
_ => Err(Error::Unknown("Unable to get Device count.")),
}
}
unsafe fn ffi_device_get_count(
count: *mut ::libc::c_int
) -> Result<(), Error> {
match cuDeviceGetCount(count) {
CUresult::CUDA_SUCCESS => Ok(()),
CUresult::CUDA_ERROR_DEINITIALIZED => Err(Error::Deinitialized("CUDA got deinitialized.")),
CUresult::CUDA_ERROR_NOT_INITIALIZED => Err(Error::NotInitialized("CUDA is not initialized.")),
CUresult::CUDA_ERROR_INVALID_CONTEXT => Err(Error::InvalidContext("No valid context available.")),
CUresult::CUDA_ERROR_INVALID_VALUE => Err(Error::InvalidValue("Invalid value provided.")),
_ => Err(Error::Unknown("Unable to get Device count.")),
}
}
unsafe fn ffi_device_get_attribute(
pi: *mut ::libc::c_int,
attrib: CUdevice_attribute,
device: CUdevice,
) -> Result<(), Error> {
match cuDeviceGetAttribute(pi, attrib, device) {
CUresult::CUDA_SUCCESS => Ok(()),
CUresult::CUDA_ERROR_DEINITIALIZED => Err(Error::Deinitialized("CUDA got deinitialized.")),
CUresult::CUDA_ERROR_NOT_INITIALIZED => Err(Error::NotInitialized("CUDA is not initialized.")),
CUresult::CUDA_ERROR_INVALID_CONTEXT => Err(Error::InvalidContext("No valid context available.")),
CUresult::CUDA_ERROR_INVALID_VALUE => Err(Error::InvalidValue("Invalid value provided.")),
CUresult::CUDA_ERROR_INVALID_DEVICE => Err(Error::InvalidValue("Invalid value for `device` provided.")),
_ => Err(Error::Unknown("Unable to get device attribute."))
}
}
unsafe fn ffi_device_get_name(
name: *mut ::libc::c_char,
len: ::libc::c_int,
device: CUdevice,
) -> Result<(), Error> {
match cuDeviceGetName(name, len, device) {
CUresult::CUDA_SUCCESS => Ok(()),
CUresult::CUDA_ERROR_DEINITIALIZED => Err(Error::Deinitialized("CUDA got deinitialized.")),
CUresult::CUDA_ERROR_NOT_INITIALIZED => Err(Error::NotInitialized("CUDA is not initialized.")),
CUresult::CUDA_ERROR_INVALID_CONTEXT => Err(Error::InvalidContext("No valid context available.")),
CUresult::CUDA_ERROR_INVALID_VALUE => Err(Error::InvalidValue("Invalid value provided.")),
CUresult::CUDA_ERROR_INVALID_DEVICE => Err(Error::InvalidValue("Invalid value for `device` provided.")),
_ => Err(Error::Unknown("Unable to get device name."))
}
}
unsafe fn ffi_device_total_mem(
bytes: *mut size_t,
device: CUdevice,
) -> Result<(), Error> {
match cuDeviceTotalMem_v2(bytes, device) {
CUresult::CUDA_SUCCESS => Ok(()),
CUresult::CUDA_ERROR_DEINITIALIZED => Err(Error::Deinitialized("CUDA got deinitialized.")),
CUresult::CUDA_ERROR_NOT_INITIALIZED => Err(Error::NotInitialized("CUDA is not initialized.")),
CUresult::CUDA_ERROR_INVALID_CONTEXT => Err(Error::InvalidContext("No valid context available.")),
CUresult::CUDA_ERROR_INVALID_VALUE => Err(Error::InvalidValue("Invalid value provided.")),
CUresult::CUDA_ERROR_INVALID_DEVICE => Err(Error::InvalidValue("Invalid value for `device` provided.")),
_ => Err(Error::Unknown("Unable to get total mem of device."))
}
}
}<|fim▁end|> | use super::{API, Error};
impl API {
/// Returns fully initialized devices available through Cuda. |
<|file_name|>advent6.rs<|end_file_name|><|fim▁begin|>// advent6.rs
// christmas light grid
extern crate bit_vec;
#[macro_use] extern crate scan_fmt;
use bit_vec::BitVec;
use std::io;
#[cfg(not(test))]
const GRID_SIZE: usize = 1000;
#[cfg(test)]
const GRID_SIZE: usize = 8;
fn main() {
// Part 1 initialization
// Initialize grid of lights, all off
let row_default = BitVec::from_elem(GRID_SIZE, false);
let mut grid: Vec<BitVec> = Vec::new();
for _ in 0..GRID_SIZE {
grid.push(row_default.clone());
}
// Part 2 initialization
let mut grid2 = [[0u32; GRID_SIZE]; GRID_SIZE];
// Part 1 and 2, Parse input
loop {
let mut input = String::new();
let result = io::stdin().read_line(&mut input);
match result {
Ok(byte_count) => if byte_count == 0 { break; },
Err(_) => {
println!("error reading from stdin");
break;
}
}
parse_command(&input, &mut grid);
parse_command2(&input, &mut grid2);
}
// Part 1, Count lights
println!("Total lights: {}", count_bits(&grid));
// Part 2, Total brightness
println!("Total brightness: {}", calc_total_brightness(&grid2));
}
// Example inputs:
// "toggle 461,550 through 564,900"
// "turn off 812,389 through 865,874"
// "turn on 599,989 through 806,993"
//
// Representation:
// Vec of 1000 BitVecs, each with width 1000
fn parse_command(cmd: &str, grid: &mut Vec<BitVec>) {
if cmd.contains("toggle") {
apply_cmd(cmd, grid, "toggle ", |row, i| {
let val = row.get(i).unwrap();<|fim▁hole|> } else if cmd.contains("off") {
apply_cmd(cmd, grid, "turn off ", |row, i| row.set(i, false));
} else if cmd.contains("on") {
apply_cmd(cmd, grid, "turn on ", |row, i| row.set(i, true));
}
}
struct Range {
x1: usize,
y1: usize,
x2: usize,
y2: usize,
}
fn apply_cmd<F>(cmd: &str, grid: &mut Vec<BitVec>, cmd_head: &str, f: F)
where F: Fn(&mut BitVec, usize) {
let cmd_tail = cmd.trim_left_matches(cmd_head);
let (x1, y1, x2, y2) = scan_fmt!(cmd_tail, "{},{} through {},{}", usize, usize, usize, usize);
let range = Range {x1: x1.unwrap(), y1: y1.unwrap(), x2: x2.unwrap(), y2: y2.unwrap()};
let rows = &mut grid[range.y1..range.y2+1];
for row in rows {
for i in range.x1..range.x2+1 {
f(row, i);
}
}
}
fn count_bits(grid: &Vec<BitVec>) -> usize {
let mut total_bits = 0;
for row in grid {
total_bits += row.iter().filter(|x| *x).count();
}
total_bits
}
#[test]
fn test_part1() {
let bv = BitVec::from_elem(8, false);
let mut grid: Vec<BitVec> = Vec::new();
for _ in 0..8 {
grid.push(bv.clone());
}
let bv00 = BitVec::from_bytes(&[0]);
let bv20 = BitVec::from_bytes(&[0x20]);
let bv30 = BitVec::from_bytes(&[0x30]);
let bv40 = BitVec::from_bytes(&[0x40]);
let bv48 = BitVec::from_bytes(&[0x48]);
let mut grid1: Vec<BitVec> = Vec::new();
grid1.push(bv00.clone());
grid1.push(bv00.clone());
grid1.push(bv30.clone());
grid1.push(bv30.clone());
grid1.push(bv30.clone());
grid1.push(bv30.clone());
grid1.push(bv00.clone());
grid1.push(bv00.clone());
let mut grid2: Vec<BitVec> = Vec::new();
grid2.push(bv00.clone());
grid2.push(bv00.clone());
grid2.push(bv48.clone());
grid2.push(bv48.clone());
grid2.push(bv48.clone());
grid2.push(bv30.clone());
grid2.push(bv00.clone());
grid2.push(bv00.clone());
let mut grid3: Vec<BitVec> = Vec::new();
grid3.push(bv00.clone());
grid3.push(bv00.clone());
grid3.push(bv48.clone());
grid3.push(bv48.clone());
grid3.push(bv40.clone());
grid3.push(bv20.clone());
grid3.push(bv00.clone());
grid3.push(bv00.clone());
assert_eq!(count_bits(&grid), 0);
parse_command("turn on 2,2 through 3,5", &mut grid);
assert_eq!(grid, grid1);
assert_eq!(count_bits(&grid), 8);
parse_command("toggle 1,2 through 4,4", &mut grid);
assert_eq!(grid, grid2);
assert_eq!(count_bits(&grid), 8);
parse_command("turn off 3,4 through 4,6", &mut grid);
assert_eq!(grid, grid3);
assert_eq!(count_bits(&grid), 6);
}
fn parse_command2(cmd: &str, grid: &mut [[u32; GRID_SIZE]; GRID_SIZE]) {
if cmd.contains("toggle") {
apply_cmd2(cmd, grid, "toggle ", Box::new(|x| *x += 2));
} else if cmd.contains("off") {
apply_cmd2(cmd, grid, "turn off ", Box::new(|x| *x = if *x > 0 { *x - 1 } else { *x }));
} else if cmd.contains("on") {
apply_cmd2(cmd, grid, "turn on ", Box::new(|x| *x += 1));
}
}
fn apply_cmd2(cmd: &str, grid: &mut [[u32; GRID_SIZE]; GRID_SIZE], cmd_head: &str, f: Box<Fn(&mut u32)>) {
let cmd_tail = cmd.trim_left_matches(cmd_head);
let (x1, y1, x2, y2) = scan_fmt!(cmd_tail, "{},{} through {},{}", usize, usize, usize, usize);
let range = Range {x1: x1.unwrap(), y1: y1.unwrap(), x2: x2.unwrap(), y2: y2.unwrap()};
let rows = &mut grid[range.y1..range.y2+1];
for row in rows {
let lights = &mut row[range.x1..range.x2+1];
for light in lights {
f(light);
}
}
}
fn calc_total_brightness(grid: &[[u32; GRID_SIZE]; GRID_SIZE]) -> u32 {
grid.iter().fold(0, |x,row| x + row.iter().fold(0, |y,z| y + z))
}
#[test]
fn test_part2() {
let mut grid = [[0u32; GRID_SIZE]; GRID_SIZE];
parse_command2("turn on 0,0 through 0,0", &mut grid);
assert_eq!(1, calc_total_brightness(&grid));
parse_command2("turn off 0,0 through 0,0", &mut grid);
assert_eq!(0, calc_total_brightness(&grid));
parse_command2("turn on 2,2 through 3,5", &mut grid);
assert_eq!(8, calc_total_brightness(&grid));
parse_command2("toggle 1,2 through 4,4", &mut grid);
assert_eq!(32, calc_total_brightness(&grid));
parse_command2("turn off 3,4 through 4,6", &mut grid);
assert_eq!(29, calc_total_brightness(&grid));
}<|fim▁end|> | row.set(i, !val); }); |
<|file_name|>IAMCapabilities.java<|end_file_name|><|fim▁begin|>/*
* Copyright (C) 2009-2015 Dell, Inc.
* See annotations for authorship information
*
* ====================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.<|fim▁hole|>
import org.dasein.cloud.AbstractCapabilities;
import org.dasein.cloud.CloudException;
import org.dasein.cloud.InternalException;
import org.dasein.cloud.aws.AWSCloud;
import org.dasein.cloud.identity.IdentityAndAccessCapabilities;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Locale;
/**
* Created by stas on 18/06/15.
*/
public class IAMCapabilities extends AbstractCapabilities<AWSCloud> implements IdentityAndAccessCapabilities {
public IAMCapabilities(AWSCloud provider) {
super(provider);
}
@Override
public boolean supportsAccessControls() throws CloudException, InternalException {
return true;
}
@Override
public boolean supportsConsoleAccess() throws CloudException, InternalException {
return true;
}
@Override
public boolean supportsAPIAccess() throws CloudException, InternalException {
return true;
}
@Nullable
@Override
public String getConsoleUrl() throws CloudException, InternalException {
return String.format("https://%s.signin.aws.amazon.com/console", getContext().getAccountNumber());
}
@Nonnull
@Override
public String getProviderTermForUser(Locale locale) {
return "user";
}
@Nonnull
@Override
public String getProviderTermForGroup(@Nonnull Locale locale) {
return "group";
}
}<|fim▁end|> | * ====================================================================
*/
package org.dasein.cloud.aws.identity; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.