WEBVTT

00:01.270 --> 00:04.190
Write going on to when you are quite in five.

00:04.190 --> 00:10.340
For now let's go for the next concept that is backcrosses.

00:10.710 --> 00:12.570
I'll just close all of them.

00:14.740 --> 00:15.260
OK.

00:15.560 --> 00:20.930
So this is when you want to create your own data structure you create a class so you create a class

00:20.930 --> 00:23.030
with just a keyword class.

00:23.030 --> 00:28.610
And let's see if for example I want to create a class so if I want to create a class of friends you

00:28.610 --> 00:33.950
know of an embedded system or let me say let me see iOS device.

00:34.100 --> 00:34.720
OK.

00:34.910 --> 00:40.130
The device says OK let me see class Id devices.

00:40.390 --> 00:40.930
OK.

00:40.970 --> 00:43.350
And of course it's.

00:43.520 --> 00:47.430
Let me just make it.

00:47.540 --> 00:51.740
I ot devices where icecap de-couple out here.

00:51.740 --> 00:52.340
All right.

00:52.470 --> 01:00.940
All I can do is if you remember I had created an image matter where

01:04.300 --> 01:12.980
it method is the one which is used for whenever an object of this particular class is created.

01:13.280 --> 01:13.820
Right.

01:13.970 --> 01:24.750
The inner discord and the object when you know so I can just see we here print an object of clause I

01:24.770 --> 01:28.280
O devices has been created.

01:28.400 --> 01:36.770
Right so if I say out here I can say I can say you know in my in my main code I'm going to create an

01:36.770 --> 01:42.560
object of coyote demises so I added devices is a class name and if I create an object of it let's say

01:42.560 --> 01:48.200
for example in IO devices the first thing that we would think of is maybe you know I'll create an object

01:48.200 --> 01:49.140
call the stress.

01:49.340 --> 01:57.600
So when I get harassed by and is when I create an address by interface a control shift f 10.

01:57.650 --> 02:03.770
Can you see the minute I created this it says an object of class Id devices has been created.

02:03.890 --> 02:09.610
The minute you create an object of a particular class by default the better the school and when the

02:09.790 --> 02:10.950
to school.

02:11.460 --> 02:12.050
OK.

02:12.140 --> 02:20.090
The object which Goldstein it mattered is fast passes itself into the method process itself and as a

02:20.090 --> 02:26.870
result you need to take it in a variable called a sense where it seen that and of course since you know

02:26.930 --> 02:29.020
this is how it works.

02:29.060 --> 02:30.070
All right.

02:30.130 --> 02:33.220
But let's say for example I am creating.

02:33.290 --> 02:38.920
I want to create something more like I need to see what is the name of this particular device.

02:39.090 --> 02:42.410
OK so I need to create the name and I want to create.

02:42.680 --> 02:46.920
What type of device is it comes under control.

02:47.090 --> 02:47.900
It is.

02:48.020 --> 02:50.610
You know it is an equipment or something like that.

02:50.690 --> 02:56.080
So let me see the name of this device can be.

02:56.130 --> 02:59.370
So I'm going to say the name of this device of course rest by.

02:59.930 --> 03:02.250
And it comes under.

03:02.660 --> 03:09.050
It comes under the controller and it comes you know the cost of it comes around.

03:09.650 --> 03:11.410
Let's say three five double.

03:11.770 --> 03:14.390
That's about an approximate cost.

03:14.390 --> 03:15.070
Right.

03:15.290 --> 03:21.020
So now when I if I run this it will give me an error which says if it takes only one position argument

03:21.050 --> 03:25.440
but four were given you give these three plus you give the object.

03:25.670 --> 03:27.560
But it takes only one.

03:27.560 --> 03:27.900
OK.

03:27.920 --> 03:29.970
So you give four but actually one.

03:30.200 --> 03:34.090
So I needed to find this method of protecting the other.

03:34.190 --> 03:40.190
The other part of me just passed let's see for example Russ spice you know digging into an into a local

03:40.190 --> 03:41.980
variable out there Colus name.

03:42.080 --> 03:48.600
Another one called S-type and you need to say the three €500 can be the cost.

03:48.780 --> 03:53.000
Now when I see this let's say for example.

03:53.360 --> 03:59.340
I send this particular you know I send these particular paramita into the unit Mehtar it goes in as

03:59.360 --> 04:04.520
local variables but once it comes out of this method once it comes out of this method these variables

04:04.520 --> 04:04.920
are lost.

04:04.930 --> 04:06.500
These variables are no longer there.

04:06.830 --> 04:15.020
But if I can do something where these really boots or these particular baramin does that I've got if

04:15.020 --> 04:20.120
I can assign them as an attribute to this particular object that I created.

04:20.160 --> 04:26.480
Second if I can assign them as attributes of this particular object that I created then I can access

04:26.480 --> 04:28.470
them anytime I want with the object.

04:28.790 --> 04:32.220
So I can assign them by saying self-taught.

04:32.510 --> 04:39.290
Self-taught mean I'm going to create an attribute call list name for self.

04:39.320 --> 04:44.870
That means for that object I'm going to create an attribute class type for that particular object and

04:44.870 --> 04:49.080
I'm going to say type and Selter cost.

04:49.100 --> 04:51.620
It's going to be equal to the cost.

04:51.740 --> 04:52.190
Right.

04:52.340 --> 04:52.790
OK.

04:52.790 --> 04:55.130
So anytime I want.

04:55.190 --> 04:58.550
I want to access the name of this particular device.

04:58.580 --> 05:02.620
OK the device name is a printed right.

05:02.690 --> 05:03.420
Grin.

05:03.660 --> 05:06.780
The device name is what is it.

05:06.960 --> 05:11.130
Comma the rest by DOT name.

05:11.300 --> 05:12.110
Correct.

05:12.170 --> 05:20.930
And then if I print cost costs what is the cost going to be I need to access it with the object name

05:21.440 --> 05:23.610
dot cost.

05:23.750 --> 05:25.300
So you have this.

05:25.850 --> 05:31.170
So you have this cost which you know which can be displayed so if I do a control shift f 10.

05:31.280 --> 05:32.780
So the device name is Russ by.

05:32.780 --> 05:34.380
And the cost is three fidelity.

05:34.400 --> 05:39.670
So instead of saying instead of saying rest I can say device 1.

05:39.710 --> 05:45.610
So I just need a change because the name of the rasper do I want is I spy.

05:45.620 --> 05:46.470
So let me see.

05:46.470 --> 05:49.800
Each of the device or device one cost.

05:50.120 --> 05:53.840
So I have assigned to device one a name and a cost.

05:53.870 --> 06:00.860
Let's say I create another device let me say device 2 and I say I LTE devices and this time I need to

06:00.980 --> 06:02.370
I need to boss another name.

06:02.390 --> 06:05.020
Let me say the name that I want to posses.

06:05.060 --> 06:07.580
Let me say I want to pass.

06:07.640 --> 06:09.150
Let me see a DMM.

06:09.470 --> 06:09.900
OK.

06:09.930 --> 06:11.940
Our digital multi-meter.

06:12.200 --> 06:16.280
DMM it will be nothing but it's not a controller but it is.

06:16.550 --> 06:23.330
It is an equipment you can see it's an equipment type as an equipment and a way to ease the cost of

06:23.330 --> 06:24.470
the diabetes.

06:24.480 --> 06:31.680
You can see a good one around 500 to 1000 Grange right talking Ghanaian.

06:32.000 --> 06:37.940
And of course you can print the device to details by saying yeah.

06:38.340 --> 06:47.270
Device to dot dot name come on device to dot cost correct control Chidester.

06:47.510 --> 06:50.000
So DMM and the cost of that is 500.

06:50.010 --> 06:59.630
I can keep creating devices having my own custom it's my own custom class my own custom data structure

07:00.080 --> 07:05.240
my own custom attributes which are getting created each time.

07:05.240 --> 07:05.970
Things like that.

07:06.880 --> 07:07.200
Right.

07:07.200 --> 07:13.210
So that's about if for example they create more methods in this let me say def if you create a method

07:13.210 --> 07:21.490
called as if I call if I create a meticulous print details print details it will take a selfie and all

07:21.490 --> 07:25.060
it does is print you know the name of the device

07:27.400 --> 07:36.810
is the name the device is what does it whatever method whatever object calls it I'll say cells name

07:37.810 --> 07:49.920
friend you're going to say it is off type come on Celtel type and I will train cost.

07:50.100 --> 07:51.410
And what's going to be the cost.

07:51.420 --> 07:53.550
So stop cost.

07:53.720 --> 07:54.630
Right.

07:55.350 --> 08:01.890
So this is what we're going to have so I don't need to any more to this printing out here because I

08:01.890 --> 08:03.840
can use that method.

08:04.080 --> 08:12.990
I can just say print no I need to say device 1 I need to call it using an object using an object I'll

08:12.990 --> 08:22.070
call that method call list put in details right and I'll call device to dot green details right.

08:22.080 --> 08:23.340
Control your data.

08:23.490 --> 08:27.710
So when device one device too has been created say is an object of cluster.

08:27.750 --> 08:33.370
I have been paid enough data plus I do the name of the devices that I Spy and is a type controller.

08:33.480 --> 08:38.320
The other DM's of type equipment costs this all right.

08:38.490 --> 08:41.430
One last thing about one last thing about this.

08:41.430 --> 08:46.830
Let's say for example if you want to have a count of the devices being stored in a particular variable

08:46.830 --> 08:51.550
you can create a class attribute count which is you should use zero.

08:51.840 --> 08:55.110
But whenever an object is created you can increment.

08:55.230 --> 09:02.110
You can increment the count of this particular Brierty devices Darktown I can make it plus equal to

09:02.120 --> 09:02.880
1.

09:03.180 --> 09:04.050
Right.

09:04.080 --> 09:13.910
And if you want if you want you know you can create another method def get gownd which is going to which

09:13.920 --> 09:18.200
you get kown can be called by the object as well as by the class.

09:18.200 --> 09:20.440
So I need to create it as a static method.

09:20.610 --> 09:29.580
So I would say at static metor a decree to write which will give me a static method which would be a

09:29.670 --> 09:34.180
static method which can be called a call using a class name as well as window.

09:34.470 --> 09:38.620
What is it return that returns the iOS devices don't count.

09:38.760 --> 09:44.730
Of course if you want to make it count as a private variable which cannot be accessed outside I need

09:44.730 --> 09:52.410
to put an underscore underscore write and I need to it can be accessed now really inside the class right.

09:52.420 --> 09:53.890
I cannot access it anymore.

09:53.890 --> 09:55.360
I'll take the class.

09:55.380 --> 09:55.920
Great.

09:56.140 --> 10:03.080
So here we have so one device one is created.

10:03.160 --> 10:10.010
I need to say print count equal to count equals the comma.

10:10.320 --> 10:18.450
I need to say I have two devices don't get count right.

10:18.710 --> 10:21.040
Or after device 2 was created.

10:21.050 --> 10:30.450
I can say print count now because get called is a static metric and even call it with an object name.

10:30.450 --> 10:32.500
So I call it device to get count.

10:32.530 --> 10:34.880
You can call it with the object name or even with the.

10:35.110 --> 10:35.700
OK.

10:35.720 --> 10:37.840
So Control shift at 10.

10:37.880 --> 10:43.030
So it says an object in the first case counters one next case count was.

10:43.040 --> 10:48.940
So as you create objects more and more the count keeps incrementing whenever an object is created.

10:49.240 --> 10:49.550
Correct.

10:49.580 --> 10:54.100
So this is how we can have a custom class custom data structure created.

10:54.230 --> 10:56.210
That's about the nuts and bolts out here.

10:56.390 --> 10:57.140
OK.

10:57.580 --> 11:07.130
We're now going to go with 2 to two degree concepts and to to higher concepts that we have in some time.

11:07.130 --> 11:15.020
Let's say for example we're now going to go into certain concepts that we didn't cover before but as

11:15.020 --> 11:20.930
a whole it requires the major concept of networking which we're going to deal with in detail in the

11:20.930 --> 11:24.110
next session right up to now.

11:24.260 --> 11:29.780
This was covered maybe in the basics but now we're going to go into something which is which are not

11:30.020 --> 11:32.050
which were not covered earlier.

11:32.150 --> 11:36.280
And we're going to go for the networking part of it in the next session.
